当前位置: 移动技术网 > IT编程>网页制作>HTML > MongoDb基本使用

MongoDb基本使用

2020年07月14日  | 移动技术网IT编程  | 我要评论

MongoDb基本使用

1. use nodeblog – 使用nodebolg这个数据库

2. db.users.findOne() – 查看作者信息

3. db.posts.insert({ title: ‘First Post in HTML’, content: ‘First Post in HTML’, category: ObjectId(“5f0a5f0e9fe2c05078c6cef6”), author: ObjectId(“5f095bb15c66e961ecdbd779”), slug: ‘first-post-in-html’, published: true, meta: { favourates: 0 }, comments: [], created: new Date() }) – 在posts中插入数据

4. db.categories.find().pretty() – 查看categories中所有的数据

本文地址:https://blog.csdn.net/Cool_breeze_/article/details/107305781

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网