随笔分类 - MongoDB
有关MongoDB工作或者文档的记录
22.Atomicity and Transactions-官方文档摘录
摘要:原子性和事务 1 在单个文档修改多个嵌入文档,写操作都在文档级别上都是原子的 2 在单个写操作修改多个文档时,每个文档的修改都具有原子性,但是,作为一个整体的操作,并不是原子的。其他操作可能有交互。使用$isolated操作符隔离单个写操作,可以影响多个文档 3 使用$isolated操作符,影响多
阅读全文
21.SQL to MongoDB Mapping Chart-官方文档摘录
摘要:有关关系型数据库跟Mongod的语法对比 In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of commo
阅读全文
19.Delete Documents-官方文档摘录
摘要:1 插入例子 2 删除所有 3 删除匹配的行 4 删除最多一行记录 5 注意 This page provides examples of delete operations using the following methods in the mongo shell: db.collection.
阅读全文
17.Delete Methods-官方文档摘录
摘要:介绍delete的方法 MongoDB provides the following methods to delete documents of a collection: Delete at most a single document that match a specified filter
阅读全文
16.Update Methods-官方文档摘录
摘要:这里没什么好说的,直接贴文了 MongoDB provides the following methods for updating documents in a collection: Updates at most a single document that match a specified
阅读全文
15.Update Documents-官方文档摘录
摘要:1.插入数据 2 更新语句$set 可以看到,如果没有的字段,则新增进去,同时修改了对应修改的内容 3 更新多条 4 替换 This page provides examples of how to update documents in using the following methods in
阅读全文
14.Iterate a Cursor in the mongo Shell-官方文档摘录
摘要:1 迭代游标 2 迭代指数 可以简化成 3 关闭游标,不活跃的游标需要等到10分钟才自动关闭,可以通过指定时间来进行关闭 4 find(), aggregate(), listIndexes, and listCollections 最大是16MB The db.collection.find()
阅读全文
13.Query for Null or Missing Fields-官方文档摘录
摘要:1 插入数据 2 查询null值 如果要精确查找到对应的null的字段,应该 3 查询是否存在这个元素 Different query operators in MongoDB treat null values differently. This page provides examples of
阅读全文
12.Project Fields to Return from Query-官方文档摘录
摘要:1 插入例句 2.只显示需要显示的部分 将ID列也省去 3.查找内嵌文档 4.对数组的查找 By default, queries in MongoDB return all fields in matching documents. To limit the amount of data that
阅读全文
11.Query an Array of Embedded Documents-官方文档摘录
摘要:总结 1.插入数据 2.查找嵌套在数组中的文档 3.根据数组索引查找内嵌文档元素 如果不是精确到具体的索引元素,则只要里面满足即可展现 4.使用elemMatch来查找符合数组元素的条件 5.使用elemMatch查找范围 This page provides examples of query o
阅读全文
10.Query an Array-官方文档摘录
摘要:1.插入 2.匹配数组 使用$all可以找到自己制定包含在数据中的元素 可以根据数组索引位置查找元素 通过数组长度查询 This page provides examples of query operations on array fields using the db.collection.fi
阅读全文
9.Query on Embedded/Nested Documents-官方文档摘录
摘要:1.插入案例 2.匹配内嵌文档 如果顺序不一致,则无法出正确数据 3 在嵌套字段中查找 This page provides examples of query operations on embedded/nested documents using thedb.collection.find()
阅读全文
8.Query Documents-官方文档摘录
摘要:总结 1 先插入数据 2 查询所有数据 3 指定相等条件 4 指定查询运算条件 5 指定and的条件 6 指定or条件 7 指定and和or的条件 This page provides examples of query operations using the db.collection.find
阅读全文
7.Insert Methods-官方文档摘录
摘要:总结 列举insert插入方法 MongoDB provides the following methods for inserting documents into a collection: Additional Methods for Inserts The following methods
阅读全文
6.Insert Documents-官方文档摘录
摘要:总结 1.插入单文档 2.插入多文档 This page provides examples of insert operations in MongoDB. CREATING A COLLECTION If the collection does not currently exist, inse
阅读全文
5.MongoDB CRUD Operations-官方文档摘录
摘要:总结 1. CRUD:create, read, update, and delete DOCUMENT 2.在3.2版本的插入方式 db.users.insertOne({ name:"sue", age:26, status:"pending" }) 3 Read 操作 4 Update操作 d
阅读全文
4.Data Types in the mongo Shell-官方文档摘录
摘要:总结: 1.MongoDB 的BSON格式支持额外的数据类型 2 Date 对象内部存储64位字节存整数,存储使用NumberLong()这个类来存,使用NumberInt()存32位整数,128位十进制的用NumberDecimal()存储(这个函数是为了方便的存储财政数据) 3 时间的三个方法
阅读全文
3.Write Scripts for the mongo Shell-官方文档摘录
摘要:总结 1 使用js进行获取数据的方法 2 js方式和原生mongo shell的交互方式的区别写法 3 需要将所有数据打印出来使用到的循环示例 4 介绍怎么外部执行js文件 5 介绍怎么在mongo shell中加载js文件 You can write scripts for the mongo s
阅读全文
2.Access the mongo Shell Help-官方文档摘录
摘要:总结: 1.使用help可以查看帮助信息db.help() help等 2.查看对应的实现方法.比如 3 查看封装好的类的方法可以使用help xxx,比如BinData()这个方法,在misc类中,则help misc In addition to the documentation in the
阅读全文
1.Configure the mongo Shell-官方文档摘录
摘要:Configure the mongo Shell
阅读全文
浙公网安备 33010602011771号