On this page本页内容
In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.除了下面的图表之外,您还可能需要考虑常见问题部分来选择关于MunGDB的常见问题。
The following table presents the various SQL terminology and concepts and the corresponding MongoDB terminology and concepts.下表列出了各种SQL术语和概念以及相应的MongoDB术语和概念。
$lookup | |
|
|
| |
SELECT INTO NEW_TABLE |
|
MERGE INTO TABLE |
|
UNION ALL | $unionWith |
Tip
|
The following table presents some database executables and the corresponding MongoDB executables. 下表显示了一些数据库可执行文件和相应的MongoDB可执行文件。This table is not meant to be exhaustive.本表并非详尽无遗。
MongoDB | MySQL | Oracle | Informix | DB2 | |
---|---|---|---|---|---|
mongod |
mysqld |
oracle |
IDS |
DB2 Server | |
mongo |
mysql |
sqlplus |
DB-Access |
DB2 Client |
The following table presents the various SQL statements and the corresponding MongoDB statements. 下表显示了各种SQL语句和相应的MongoDB语句。The examples in the table assume the following conditions:表中的示例假设以下条件:
people
.people
的表。people
that contain documents of the following prototype:people
的集合包含以下原型的文档:
The following table presents the various SQL statements related to table-level actions and the corresponding MongoDB statements.下表显示了与表级操作相关的各种SQL语句以及相应的MongoDB语句。
| |
| |
| |
For more information on the methods and operators used, see:有关所用方法和运算符的更多信息,请参阅:
The following table presents the various SQL statements related to inserting records into tables and the corresponding MongoDB statements.下表显示了与向表中插入记录相关的各种SQL语句以及相应的MongoDB语句。
SQL INSERT Statements | MongoDB insertOne() Statements |
---|---|
For more information, see 有关更多信息,请参阅db.collection.insertOne()
.db.collection.insertOne()
。
The following table presents the various SQL statements related to reading records from tables and the corresponding MongoDB statements.下表显示了与从表中读取记录相关的各种SQL语句以及相应的MongoDB语句。
Note
The find()
method always includes the _id
field in the returned documents unless specifically excluded through projection. find()
方法总是在返回的文档中包含_id
字段,除非通过投影明确排除。Some of the SQL queries below may include an 下面的一些SQL查询可能包含一个_id
field to reflect this, even if the field is not included in the corresponding find()
query._id
字段来反映这一点,即使该字段未包含在相应的find()
查询中。
SQL SELECT Statements | MongoDB find() Statements |
---|---|
-or- |
|
-or- |
|
or |
|
or |
|
or |
|
|
|
or |
|
For more information on the methods and operators used, see有关所用方法和运算符的更多信息,请参阅
The following table presents the various SQL statements related to updating existing records in tables and the corresponding MongoDB statements.下表显示了与更新表中现有记录相关的各种SQL语句以及相应的MongoDB语句。
SQL Update Statements | MongoDB updateMany() Statements |
---|---|
For more information on the method and operators used in the examples, see:有关示例中使用的方法和运算符的更多信息,请参阅:
The following table presents the various SQL statements related to deleting records from tables and the corresponding MongoDB statements.下表显示了与从表中删除记录相关的各种SQL语句以及相应的MongoDB语句。
SQL Delete Statements | MongoDB deleteMany() Statements |
---|---|
For more information, see 有关更多信息,请参阅db.collection.deleteMany()
.db.collection.deleteMany()
。
See also参阅
If you are considering migrating your SQL application to MongoDB, download the MongoDB Application Modernization Guide.如果您正在考虑将SQL应用程序迁移到MongoDB,请下载MongoDB应用程序现代化指南。
The download includes the following resources:下载内容包括以下资源: