Giter Site home page Giter Site logo

mohdriyaan / mongodb-methods Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suhailroushan13/mongodb-methods

0.0 0.0 0.0 17 KB

MongoDB is a NoSQL document-oriented database system. It provides a rich set of methods and functions to interact with the database. Here are some of the most commonly used methods in MongoDB

Home Page: https://github.com/suhailroushan13/MongoDB-Methods

JavaScript 100.00%

mongodb-methods's Introduction

MongoDB-Methods

MongoDB is a NoSQL document-oriented database system. It provides a rich set of methods and functions to interact with the database. Here are some of the most commonly used methods in MongoDB:

Collection Management

  • db.collection(): Returns a reference to a collection.
  • collection.countDocuments(): Returns the number of documents in a collection.
  • collection.createIndex(): Creates an index on a collection.
  • collection.deleteMany(): Deletes multiple documents from a collection.
  • collection.deleteOne(): Deletes a single document from a collection.
  • collection.drop(): Drops a collection from a database.
  • collection.find(): Returns a cursor to a set of documents in a collection.
  • collection.findOne(): Returns a single document from a collection.
  • collection.findOneAndDelete(): Deletes a single document and returns it.
  • collection.findOneAndReplace(): Replaces a single document and returns it.
  • collection.findOneAndUpdate(): Updates a single document and returns it.
  • collection.insertMany(): Inserts multiple documents into a collection.
  • collection.insertOne(): Inserts a single document into a collection.
  • collection.replaceOne(): Replaces a single document in a collection.
  • collection.updateMany(): Updates multiple documents in a collection.
  • collection.updateOne(): Updates a single document in a collection.

Installation

git clone [email protected]:suhailroushan13/MongoDB-Methods.git
cd MongoDB-Methods
  • Add Your MongoDB URI in Config Folder in default.json file

  • Add Your Collection Name in 3rd Parameter in Models Folder inside index.js file const userModel = new mongoose.model("Suhail", userSchema, "methods"); change the collection Name from methods to "YOUR-COLLECTION-NAME"

  • To Test Methods

#Example
node ./controllers/insertMany.js 
node ./controllers/insertOne.js 

mongodb-methods's People

Contributors

suhailroushan13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.