I have a node.js application that pulls some data and sticks it into an object, like this: var results = new Object(); User.findOne(query, function(err, u) { results.userId = u._id;...
  • May 19, 2022
  • 0 Comments
Assuming I have a collection in MongoDB with 5000 records, each containing something similar to: { "occupation":"Doctor", "name": { "first":"Jimmy", "additional":"Smith" } Is there an easy way to rename...
  • May 19, 2022
  • 0 Comments
I am playing around with MongoDB trying to figure out how to do a simple SELECT province, COUNT(*) FROM contest GROUP BY province But I can’t seem to figure...
  • May 19, 2022
  • 0 Comments
I am trying to add authorization to my MongoDB. I am doing all this on Linux with MongoDB 2.6.1. My mongod.conf file is in the old compatibility format (this...
  • May 19, 2022
  • 0 Comments
Suppose the mongodb document(table) ‘users’ is { _id: 1, name: { first: 'John', last: 'Backus' }, birth: new Date('Dec 03, 1924'), death: new Date('Mar 17, 2007'), contribs: ['Fortran', 'ALGOL',...
  • May 18, 2022
  • 0 Comments
Basically I have a mongodb collection called ‘people’ whose schema is as follows: people: { name: String, friends: [{firstName: String, lastName: String}] } Now, I have a very basic...
  • May 18, 2022
  • 0 Comments