PowerSQL By Prashanth Jayaram

Blog Post

MongoDB – Insert,Update,Upsert and Delete Examples – CRUD

In MongoDB we have to use either insert() or save() method to add the document to a collection

Insert Single document
> db.employee.insert( 
    {"employee_id":1101, 
    "name":"Prashanth", 
    "sal":90000, 
    "dob": newDate(1983,2,3,5,20), 
    "department": 
        [ 
            'DB Amdin','DB Developer' 
        ], 
    "Location":"New York"});
Insert Multiple...

2016-04-20

729 reads

Blog Post

MongoDB -Get Total datasize of all DB’s

var sum = 0; db.getMongo().getDBs()[“databases”].forEach(function(x) { sum += db.getMongo().getDB(x.name).stats().dataSize }); print(sum );

OR
db = db.getSiblingDB(“admin”);
dbs = db.runCommand({ “listDatabases”: 1 }).databases;
var sum1=0;dbs.forEach(function(database) { sum1+=db.getMongo().getDB(database.name).stats().dataSize }); print(sum1);

2016-04-11

436 reads

Blogs

FabCon 2025 Recap

By

Hey fellow data friends! Wow, March was an absolutely crazy month (in the best...

Privacy Policy

By

We value your privacy. This policy explains what personal data we collect and why. What...

Why use XACT_ABORT?

By

This came up one day at my work when a developer was using it....

Read the latest Blogs

Forums

Break string into SQL column regarding a specific character

By kakovatos7

Hi all, I want to separate string within a table column, accordint to a...

Importing Flat Files

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Importing Flat Files

The Fabric Modern Data Platform

By John Miner

Comments posted to this topic are about the item The Fabric Modern Data Platform

Visit the forum

Question of the Day

Importing Flat Files

What types of sources can be used with the Import Flat File Wizard in SQL Server Management Studio (SSMS)?

See possible answers