I used two NOSQL databases, MongoDB and Neo4j , to process the same information. I want to compare performance using the first and second db. I discussed my problem with MongoDB on this issue : millis runtime was always 0. So I added about 250 documents to my collection, but without any success: / p>
> db.team.find({common_name:"Milan"},{_id:0, "stadium.name":1}).explain("executionStats") { "queryPlanner" : { "plannerVersion" : 1, "namespace" : "Progettino.team", "indexFilterSet" : false, "parsedQuery" : { "common_name" : { "$eq" : "Milan" } }, "winningPlan" : { "stage" : "PROJECTION", "transformBy" : { "_id" : 0, "stadium.name" : 1 }, "inputStage" : { "stage" : "COLLSCAN", "filter" : { "common_name" : { "$eq" : "Milan" } }, "direction" : "forward" } }, "rejectedPlans" : [ ] }, "executionStats" : { "executionSuccess" : true, "nReturned" : 1, "executionTimeMillis" : 0, "totalKeysExamined" : 0, "totalDocsExamined" : 253, "executionStages" : { "stage" : "PROJECTION", "nReturned" : 1, "executionTimeMillisEstimate" : 0, "works" : 255, "advanced" : 1, "needTime" : 253, "needFetch" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, "transformBy" : { "_id" : 0, "stadium.name" : 1 }, "inputStage" : { "stage" : "COLLSCAN", "filter" : { "common_name" : { "$eq" : "Milan" } }, "nReturned" : 1, "executionTimeMillisEstimate" : 0, "works" : 255, "advanced" : 1, "needTime" : 253, "needFetch" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, "direction" : "forward", "docsExamined" : 255 } } }
For example, in MongoDB, this query will work better than in Neo4j, because I used a denormalized model to represent information about the stadium teams. In fact, in Neo4j this request takes 50 ms, as you can see:

So what can I do to have runtime information in MongoDB? I have some problems if the millis runtime is always 0, because I cannot show different performance on the same queries with two different NoSQL databases.