I've been reading and reading and still am confused on what is the best way to share the same database (MongoDb) connection across whole NodeJs app. As I understand connection should be open when app starts and reused between modules. My curren...
I making multiple mongoDB queries in loop. and want to send the all results as one data array.But when I simple use the return for send the data it simply return undefined  and do not wait for results of all DB request. I also tried to use q.moulde...
MongoDB noob here...  Ok, I have a collection of students, each with a record that looks like the following.... I want to sort the 'type' : 'homework' scores in descending order.  what does that incantation look like on the mongo sh...
I know that it is a bad practice to use skip in order to implement pagination, because when your data gets large skip starts to consume a lot of memory. One way to overcome this trouble is to use natural order by _id field:  //Page 1 db.users.find(...
I know that ObjectIds contain the date they were created on. Is there a way to query this aspect of the ObjectId?...
Doc:  {    _id: 5150a1199fac0e6910000002,    name: 'some name,    items: [{       id: 23,       name: 'item name 23'    },{       id: 24,       name: 'item name 24'    }] }   Is there a way to pull a specific object from an arra...
I have a basic node.js app that I am trying to get off the ground using Express framework.  I have a views folder where I have an index.html file.  But I receive the following error when loading the web browser.     Error: Cannot find module 'h...
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...
Is it possible for 2 Meteor.Collections to be retrieving data from 2 different mongdb database servers?  Dogs = Meteor.Collection('dogs')        // mongodb://192.168.1.123:27017/dogs Cats = Meteor.Collection('cats')        // mongod...
I'm trying to select only a specific field with  exports.someValue = function(req, res, next) {     //query with mongoose     var query = dbSchemas.SomeValue.find({}).select('name');      query.exec(function (err, someValue) {         i...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.