nosql
When to Redis? When to MongoDB? [closed]
I would say, it depends on kind of dev team you are and your application needs. For example, if you require a lot of querying, that mostly means it would be more work for your developers to use Redis, where your data might be stored in variety of specialized data structures, customized for each type … Read more
Pros/cons of document-based databases vs. relational databases
You need to think of how you approach the application in a document oriented way. If you simply try to replicate how you would model the problem in an RDBMS then you will fail. There are also different trade-offs that you might want to make. ([ed: not sure how this ties into the argument but:] … Read more
MongoDB extracting values from BasicDBObject (Java)
There’s no way to chain a property name like you’re doing using the Java driver (gets for sure, and according to the this, put isn’t supposed to work either). You’ll need to get the objects one at a time like you suggested. ((DBObject)obj.get(“response”)).get(“resData”) See here for a potential future feature that would allow your syntax … Read more
Get a document in MongoDB without specifying collection
Yes, but not in a scalable way (since you must query each collection). If you have 2 or 3 collections, this might be ok, but… you probably should review your design to figure out why you’re doing this. Why are you, by the way? You get a list of all of the collections in the … Read more
Hamming Distance / Similarity searches in a database
A common approach (at least common to me) is to divide your hash bit string in several chunks and query on these chunks for an exact match. This is a “pre-filter” step. You then can perform a bitwise hamming distance computation on the returned results which should be only a smaller subset of your overall … Read more
How to return only value of a field in mongodb
Not sure what you language implementation is but the basic concept is: var result = [] db.users.find().forEach(function(u) { result.push(u.text) }) And the returned value to result is: [“Hey”,”Hi”,”Hello”,”yes”]
Unique IDs with mongodb
As long as you can guarantee uniqueness, you’re not constrained to using the default “_id” MongoDB supplies. Therefore, it’s down to you how you generate this number. If you’d like to store this number inside MongoDB, then you could store it in a separate collection and increment it for every new URL required. Incrementing a … Read more
Best Model for Representing Many to Many relationships with attributes in MongoDB
In many ways meteor’s API encourages flat relational documents, however MongoDB is a non-relational data store. This conflict is, unfortunately, left as an exercise for the developer to solve. The notion of schema structure and joins is an enormous topic to cover within a single answer, so I will attempt to be as succinct as … Read more