MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms.
285
votes
10answers
68k views
When to use MongoDB or other document oriented database systems?
We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, ...
128
votes
5answers
49k views
How to query mongodb with “like”?
I'm using mongodb 1.4.
I want query something as SQL's like.
For an example in SQL:
select * from users where name like '%m%'
How to do the same in mongodb? I can't find a operator for like in ...
44
votes
3answers
28k views
MongoDB and “joins”
I'm sure MongoDB doesn't officially support "joins". What does this mean?
Does this mean "We cannot connect two collections(tables) together."?
I think if we put the value for _id in collection A to ...
168
votes
6answers
74k views
MongoDB vs. Cassandra [closed]
I am evaluating what might be the best migration option.
Currently, I am on a sharded MySQL (horizontal partition), with most of my data stored in JSON blobs. I do not have any complex SQL queries ...
67
votes
8answers
16k views
Random record from MongoDB
I am looking to get a random record from a huge (100 million record) mongodb. What is the fastest and most efficient way to do so? The data is already there and there are no field in which I can ...
23
votes
4answers
11k views
MongoDB extract only the selected item in array
Suppose you have the following:
// Document 1
{ "shapes" : [
{"shape" : "square", "color" : "blue"},
{"shape" : "circle","color" : "red"}
]
}
// Document 2
{ "shapes" : [
{"shape" : ...
76
votes
5answers
15k views
Ways to implement data versioning in MongoDB
Can you share your thoughts how would you implement data versioning in MongoDB. (I've asked similar question regarding Cassandra. If you have any thoughts which db is better for that please share)
...
19
votes
3answers
5k views
MongoDB: Updating documents using data from the same document
I have a list of documents, each with lat and lon properties (among others).
{ 'lat': 1, 'lon': 2, someotherdata [...] }
{ 'lat': 4, 'lon': 1, someotherdata [...] }
[...]
I want to modify it so ...
58
votes
2answers
8k views
A simple mongodb question: embed? or reference?
I'm new to mongodb from a relation-database background. I want design a question structure with some comments, but I don't know what I should do: embed? or reference?
A question with some comments, ...
68
votes
6answers
8k views
Use cases for NoSQL
NoSQL has been getting a lot of attention in our industry recently. I'm really interested in what peoples thoughts are on the best use-cases for its use over relational database storage. What should ...
32
votes
2answers
10k views
MongoDB GridFs with C#, how to store files such as images?
I'm developing a web app with mongodb as my back-end. I'd like to have users upload pictures to their profiles like a linked-in profile pic. I'm using an aspx page with MVC2 and I read that GridFs ...
16
votes
3answers
2k views
How should I implement this schema in MongoDB?
I'm trying to write a tracking script and I'm having trouble with figuring out how the database should work.
In MySQL I'd create a table that looks similar to
User:
username_name: string
...
53
votes
2answers
13k views
MongoDB Get names of all keys in collection
I'd like to get the names of all the keys in a MongoDB collection.
For example, from this:
db.things.insert( { type : ['dog', 'cat'] } );
db.things.insert( { egg : ['cat'] } );
db.things.insert( { ...
45
votes
6answers
19k views
MongoDB: Is it possible to make a case-insensitive query?
Example:
> db.stuff.save({"foo":"bar"});
> db.stuff.find({"foo":"bar"}).count();
1
> db.stuff.find({"foo":"BAR"}).count();
0
14
votes
1answer
6k views
Filtering embedded documents in MongoDB
I am having trouble grasping how to filter embedded documents in MongoDB, and am starting to think I should be using a relational association, but that feels wrong in the document-store context.
...