Copy mongodump --host < database-hos t > -d < database-nam e > --port < database-por t > --out directory
Copy mongorestore --host < database-hos t > -d < database-nam e > --port < database-por t > foldername
Copy mongorestore --uri= "uri" --dir= "dir"
Copy db . collectionname .find ({ "name" : { '$regex' : '^File' }})
# All the documents that start with File
Copy # Example
db . agents .find () .forEach ((doc) => { doc .tags[ 0 ] = doc .tags[ 0 ] .replace ( ">" , "-" ); db . agents .save (doc); });
Copy collection . count_documents (query_string)
Copy try :
result = self . settings_store . admin_users . update_one (user_query, language_insert)
return result . matched_count > 0
except errors . PyMongoError as e :
return False