Top "Mongodb-query" questions

This tag is for questions related to querying and updating MongoDB collections, either through the mongo shell or using a programming language driver.

How to query MongoDB with "like"?

I want to query something with SQL's like query: SELECT * FROM users WHERE name LIKE '%m%' How to …

sql mongodb mongodb-query sql-like
Find objects between two dates MongoDB

I've been playing around storing tweets inside mongodb, each object looks like this: { "_id" : ObjectId("4c02c58de500fe1be1000005"), "…

mongodb datetime twitter mongodb-query
Query for documents where array size is greater than 1

I have a MongoDB collection with documents in the following format: { "_id" : ObjectId("4e8ae86d08101908e1000001"), "name" : ["Name"], "zipcode" : ["2223"] } { "_…

mongodb mongodb-query
Retrieve only the queried element in an object array in MongoDB collection

Suppose you have the following documents in my collection: { "_id":ObjectId("562e7c594c12942f08fe4192"), "shapes":[ { "shape":"square", "color":"…

mongodb mongodb-query aggregation-framework projection
MongoDB: Combine data from multiple collections into one..how?

How can I (in MongoDB) combine data from multiple collections into one collection? Can I use map-reduce and if so …

mongodb mongodb-query aggregation-framework
How to remove a field completely from a MongoDB document?

{ name: 'book', tags: { words: ['abc','123'], lat: 33, long: 22 } } Suppose this is a document. How do I remove "words" completely …

mongodb mongodb-query database
Update MongoDB field using value of another field

In MongoDB, is it possible to update the value of a field using the value from another field? The equivalent …

mongodb mongodb-query aggregation-framework
Get names of all keys in the collection

I'd like to get the names of all the keys in a MongoDB collection. For example, from this: db.things.…

mongodb mongodb-query aggregation-framework
How to query nested objects?

I have a problem when querying mongoDB with nested objects notation: db.messages.find( { headers : { From: "[email protected]" } } ).count() 0 …

mongodb syntax nested mongodb-query bson
mongodb: insert if not exists

Every day, I receive a stock of documents (an update). What I want to do is insert each item that …

python mongodb bulkinsert mongodb-query