It seems mongo does not allow insertion of keys with a dot (.) or dollar sign ($) however when I imported a JSON file that contained a dot in it using the mongoimport tool it worked fine. The driver is complaining about trying to insert that elemen...
I use Mongoose.js and cannot solve problem with 3 level hierarchy document.  There 2 ways to do it.  First - without refs.  C = new Schema({     'title': String, });  B = new Schema({     'title': String,     'c': [C] });  A =...
how do i add a value to the top of an array in mongodb?  say i have this document in my mongo collection:  { "colors" : [ "red", "green", "blue" ] }   how do i add "yellow" to the front of the list?  when i do:...
I want to reuse MongoDB connection. I 'am aware of How to reuse mongodb connection in node.js  I want to acheive the same using Promises and Mongo driver v2  Currently I have to connect to db for every request which makes it slow. This is my code...
I’m creating a NoSQL database using Firebase, but as I’m a SQL thinker my mind needs some advices about Firebase queries and NoSQL Data Structure.  I am making some experiments for a Mobile App using also Ionic 2 (AngularJS 2), and my concerns ar...
I have used mongodb database and node.js v12.0.10 for connecting and updating mongodb collection. connection code is the following:   async.parallel({         RE5: function (cb) {             MongoClient.connect(config.riskEngineDB, function (err, r5...
I have a Firebase database structuring question. My scenario is close to a chat application. Here are the specifics  - users(node storing several users of the app)   - id1       name: John   - id2       name: Meg   - id2       name: Kelly - messages(...
While exploring mongoose for nodejs I ran into the problem of needing to know the amount of user in my collection:   My collection has records, each record has a user. I want to know the amount of unique (different) users.  How can I do this with mon...
Imagine following mongoose model:  const UserSchema = Schema({   //_id: ObjectId,   //more fields,   blockedIds: [{     type: ObjectId,     ref: 'User'   }] })   What is the most efficient way to get all users that don't match the blocked...
I have a document in Mongo that is structured in the following way:  {      "_id" : ObjectId("4eea7237d0ba3a04f20008fb"),      "code" : "b2677c2809c844cc9d7e3e4ff8d95b46",      "city_id" : 4,      "datetime...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.