Skip to content

This project demonstrates how to access MongoDB database locally using the `mongo_dart` package.

Notifications You must be signed in to change notification settings

SamvitChrungoo/dart_mongo_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dart and MongoDB

This project demonstrates how to access MongoDB database locally using the mongo_dart package.

Download and Install MongoDB

For installing MongoDB visit https://docs.mongodb.com/manual/administration/install-community/ and select your OS for instructions.

Upload json dataset into database (people.json)

(You can manually insert documents by creating a collection and then using the insert or insertMany function on your collection)

db.collection.insert(<document or array of documents>)
                OR
db.collection.insertMany([ <document 1> , <document 2>, ... ],)
  1. Start your MongoDB server

    mongod
  2. Import person.json with mongoimport executable

    mongoimport --jsonArray -d <yourDatabaseName> -c <yourCollectionName> --file <path/To/File.json>

Run the project

Execute this command in your terminal:

dart main.dart
You can use the GET, POST, PUT, DELETE methods while making the request to the localhost 
and perform the basic CRUD operations on your database locally. (using the /people endpoint)

About

This project demonstrates how to access MongoDB database locally using the `mongo_dart` package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages