随笔分类 - MongoDB
摘要:Mongoose has some hooks, for example: Before 'save' action, will trigger the function to generate the 'slug' JIT.
阅读全文
摘要:Remove: remove the wand with the name of "Doom Bringer" from our wandscollection. db.wands.remove({name: "Doom Bringer"}) >> WriteResult({'ngRemoved':
阅读全文
摘要:1. Use or create a database:use wandRecorderYou will use keyword to create or fetch a exicting database.2. Find all documents in the database.db.wands...
阅读全文
摘要:/* 1. Query Operators*/db.posts.find({ viewsCount: {$get: 1000, $lte: 3000}}, {_id: 0, viewsCount: 1, title: 1})// $indb.posts.find({ categor...
阅读全文
摘要:MongoDB is JSON Document:How to start MongoDB client:mongod //start the servermongo // start the cliHow to restore a database:mongorestorecan create a...
阅读全文
摘要:Learn how to import data into your MongoDB and then use Express to serve a simple Node.js API.Import data into MongoDB:For exmaple, you have an data.j...
阅读全文