top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Mongodb: Which of these two pymongo calls is the most optimized?

0 votes
252 views

Which of these two pymongo calls is the most optimized

A) count = db.find(nosql, {_id:True}).count()
B) count = db.find(nosql).count()

posted Jul 29, 2015 by Gurminder

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I would like to understand what is the most common architecture deployed with MongoDB.
For example, what kind of deployment is most common:
( a ) Sharded Clusters
( b ) Replica Set (no shards) with [ n ] members

I understand that a shard cluster is the way to go to scale-out your database, but what would be the performance breakdown to start a sharded cluster?

Do you recommend to start a database as sharded database?

+2 votes

Is there a way to compare two fields from different MongoDB Collections?

I have a 2 collections:
collection_1: { "english" : { "orth" : "africa", "pron" : "frik" }, "francais" : { "orth" : "afrique" } }
collection_2: { "form" : { "orth" : "afrique", "pron" : "afik" } "sense" : { "cit" : { "quote" : "africa" } }}

I would like to find all where "collection_1.english.orth" == "collection_2.form.orth" and copy/add "form.pron" from collection_2 into collection_1 under "francais.pron".

...