Coder Social home page Coder Social logo

mongocrude's Introduction

mongocrude

Mongocrude is a MongoDB query tool designed to work in an asynchronous environment while abstracting away the complexities of connecting and querying with great control of the database objects. It brings flexibility to [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete operations), so you can pick the database and collection name at the instance of your query and pass a callback to use the results to drive the logic powering your application.

Install

$ npm install mongocrude

API

var mongocrude = require('mongocrude')

This middleware gives direct access to the your database with a simple abstraction and api to reduce bugs and complexities. It supports all CRUD operations currently supported by MongoDB and includes actions such as bulkwrite without losing the strong benefits of mongodb.

Example

var db = require('mongocrude')
var uri = "mongodb://localhost:27017/app";
var assert = require('assert');

db.createOne(uri, 'users', {name: "vim"}, function(err, res){
	if (err) throw new Error("some errors" + err);
	
	db.findOne(uri, 'users', function(err, user) {
		// throw err;
		assert.equal(user.name, "vim")
		})

})

operations supported

find,
findOne,
createOne, 
createMany,
updateOne, 
updateMany,
removeOne,
findOneAndDelete,
findOneAndRemove,
findOneAndReplace,
findOneAndUpdate,
bulkWrite ...

MIT

mongocrude's People

Contributors

willpoint avatar

Watchers

happycoding 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.