Neolithic Psychedelic Mushrooms
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    my-mongo-listpublic

    my-mongo-list

    A simple todo-list module built on top of mongodb.

    Install

    npm install my-mongo-list mongodb --save

    Example

    var mongoList = require("my-mongo-list");
    var mongoURL = "mongodb://localhost:27017/mongolisttest";
    var MongoClient = require("mongodb").MongoClient;
     
    MongoClient.connect(db, { w: 1 }, function(err, db) {
      var mylist = mongoList(db);
     
      mylist.save({
        name: "hello world",
        items: [{
          name: "aaaa"
        }]
      }, function(err, list) {
        console.log(err, list);
      });
    });

    API

    ### mongolist.save(list, cb(err, saved))

    Saves a todo list. The err object is generated by Joi to support validations. The id of the todo list will be in the saved._id property.

    ### mongolist.load(id, cb(err, list))

    Load a todo list given an id.

    ### mongolist.remove(id)

    Remove a todo list given an id.

    License

    MIT

    Keywords

    none

    install

    npm i my-mongo-list

    Downloadsweekly downloads

    1

    version

    0.0.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar