Mongodb Cheat Sheet



  1. Mongodb Cheat Sheet 2020
  2. Mongodb Cheat Sheet Pdf
  3. Mongodb Cheat Sheet Github
  4. Mongodb Cheat Sheet 2019

MongoDB Cheat Sheet(Beginners).:

In this cheat sheet we gave you the basic CRUD (Create, Read, Update, Delete) commands that will be commonly used with Mongoose. Mongoose is a very easy library to get up and running with so get started and try out some commands. You can install Mongoose from npm. How to Build a Real-time Chat App With NodeJS, Socket.IO, and MongoDB In this tutorial, we’ll be building a real-time chat application with NodeJS, Express, Socket.io, and MongoDB. Here is a screenshot of what we'll build: Setup I’ll assume that you already have NodeJS and NPM installed.

Mongodb Cheat Sheet 2020

Sheet
  • show dbs -> to show databases
  • use {database name} -> To create & use a database
  • db.createCollection(“collection name”) -> To create a collection
  • db -> To check current database
  • db.dropDatabase() -> To delete/drop a database
  • db.[collection-name].drop() -> To delete/drop a collection
  • show collections -> To show collections
  • db.[collection-name].insertOne({key:value}) -> To insert one
  • db.[collection-name].insertMany([{key:value}, {key:value}]) -> To insert many
  • db.[collection-name].find(query(optional), projection(optional))-> To find data
  • db.[collection-name].find(query(optional), projection(optional)).pretty() -> To find data and prettify it
  • db.[collection-name].find().count() -> To count the number of data in a collection
  • db.[collection-name].find().sort({value:1}) -> To sort the values : -1 : Descending, 1 : Ascending
  • db.[collection-name].find().limit(value) -> To limit the data show
  • db.[collection-name].updateOne({_id:1}, {$set: {age:21}}) -> To update one set of value
  • db.[collection-name].updateMany({_id:1}, {$set: {age:21}}) -> To update many set of value
  • db.[collection-name].deleteOne({_id:1}) -> To delete
  • Mongodb Cheat Sheet Pdf

    from Tumblr https://generouspiratequeen.tumblr.com/post/641179649218576385

    -->

    APPLIES TO: SQL API

    The Azure Cosmos DB query cheat sheets help you quickly write queries for your data by displaying common database queries, operations, functions, and operators in easy-to-print PDF reference sheets. The cheat sheets include reference information for the SQL, MongoDB, Table, and Gremlin APIs.

    Choose from a letter-sized or A3-sized download.

    Letter-sized cheat sheets

    Download the Azure Cosmos DB letter-sized query cheat sheets if you're going to print to letter-sized paper (8.5' x 11').

    Oversized cheat sheets

    Download the Azure Cosmos DB A3-sized query cheat sheets if you're going to print using a plotter or large-scale printer on A3-sized paper (11.7' x 16.5').

    Next steps

    Mongodb Cheat Sheet Github

    For more help writing queries, see the following articles:

    Mongodb Cheat Sheet 2019

    • For SQL API queries, see Query using the SQL API, SQL queries for Azure Cosmos DB, and SQL syntax reference
    • For MongoDB queries, see Query using Azure Cosmos DB's API for MongoDB and Azure Cosmos DB's API for MongoDB feature support and syntax
    • For Gremlin API queries, see Query using the Gremlin API and Azure Cosmos DB Gremlin graph support
    • For Table API queries, see Query using the Table API