I don’t seem to be able to get even the most basic date query to work in MongoDB. With a document that looks something like this: { "_id" :...
Is it possible to show all collections and its contents in MongoDB? Is the only way to show one by one? 6 Answers 6
Is there a way to add created_at and updated_at fields to a mongoose schema, without having to pass them in everytime new MyModel() is called? The created_at field would...
Assume we have the following collection, which I have few questions about: { "_id" : ObjectId("4faaba123412d654fe83hg876"), "user_id" : 123456, "total" : 100, "items" : [ { "item_name" : "my_item_one",...
I am not a database expert and have no formal computer science background, so bear with me. I want to know the kinds of real world negative things that...
Is there a set of preferred naming conventions for MongoDB entitites such as databases, collections, field names? I was thinking along these lines: Databases: consist of the purpose (word...
Given this document saved in MongoDB { _id : ..., some_key: { param1 : "val1", param2 : "val2", param3 : "val3" } } An object with new information on...
I have a collected named foo hypothetically. Each instance of foo has a field called lastLookedAt which is a UNIX timestamp since epoch. I’d like to be able to...
> db.data.update({'name': 'zero'}, {'$set': {'value': 0}}) > db.data.findOne({'name': 'zero}) {'name': 'zero', 'value': 0.0} How do I get Mongo to insert an integer? Thank you 4 Answers 4
I have a problem when querying mongoDB with nested objects notation: db.messages.find( { headers : { From: "reservations@marriott.com" } } ).count() 0 db.messages.find( { 'headers.From': "reservations@marriott.com" } ).count() 5...