Report
Question
I can’t find anywhere it has been documented this. By default, the find() operation will get the records from beginning. How can I get the last N records in mongodb? Edit: also I want the returned result ordered from less recent ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
7 Answer 14 views

Report
Question
There’s a typo in my MongoDB database name and I’m looking to rename the database. I can copy and delete like so… db.copyDatabase('old_name', 'new_name'); use old_name db.dropDatabase(); Is there a command to rename a database? ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
5 Answer 23 views

Report
Question
How do I perform the SQL Join equivalent in MongoDB? For example say you have two collections (users and comments) and I want to pull all the comments with pid=444 along with the user info for each. comments { uid:12345, ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
16 Answer 37 views

Report
Question
I’m doing development on MongoDB. For totally non-evil purposes, I sometimes want to blow away everything in a database—that is, to delete every single collection, and whatever else might be lying around, and start from scratch. Is there a single ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
12 Answer 21 views

Report
Question
I’m new to MongoDB–coming from a relational database background. I want to design a question structure with some comments, but I don’t know which relationship to use for comments: embed or reference? A question with some comments, like stackoverflow, would ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
8 Answer 20 views

Report
Question
I have a MongoDB collection with documents in the following format: { "_id" : ObjectId("4e8ae86d08101908e1000001"), "name" : ["Name"], "zipcode" : ["2223"] } { "_id" : ObjectId("4e8ae86d08101908e1000002"), "name" : ["Another ", "Name"], "zipcode" : ["2224"] } I can currently get ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
9 Answer 18 views

Report
Question
Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it’s difficult to read, especially with nested arrays and documents. ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
7 Answer 18 views

Report
Question
I have tickets collection which I fetch from a web api, right now I have about 20,000 tickets but this collection will group upto 1 million or more. I want to calculate how many tickets are open closed by company wise. I ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
2 Answer 32 views

Report
Question
What is the best practice to send two independed MongoDB results in Express application via HTTP Method? Here is a short example which makes it clear: //app.js var express = require('express'); var app = express(); var testController = require('./controllers/test'); app.get('/test', testController.getCounts); ... Following getCounts() function wouldn’t work because ...

Please briefly explain why you feel this question should be reported .

Report Cancel
solved 0
2 Answer 44 views

Report
Question
I am following the approach in the below link for designing a mongodb schema for my requirement. https://docs.mongodb.com/ecosystem/use-cases/pre-aggregated-reports/ I have a schema similar to the above strucure as below. { _id: "1", date: ISODate("2000-10-10T00:00:00Z"), ...

Please briefly explain why you feel this question should be reported .

Report Cancel
0
0 Answer 144 views