这是最富有的连通提供者, 代理工具是围绕这个工具形成的: 一个它从未见过的数据库 可以在没有宣布任何计划的情况下 被映射、查询和写成。
连接连接中
const db = await api.storage.connect({
label: "Production",
type: "database",
provider: "mongodb",
endpoint: { credentials: { uri: "mongodb+srv://user:password@cluster.example.net/shop" } },
});db = api.storage.connect(
label="Production",
type="database",
provider="mongodb",
endpoint={"credentials": {"uri": "mongodb+srv://user:password@cluster.example.net/shop"}},
)credentials.uristring必填连接字符串。它带有密码,所以属于 credentials,它是加密的休息。
…/shop 选择数据库。 A URI 默认的“我的收藏”通常没有“我的收藏”,
接受什么运行() 接受
| 操作 | 读写 | 需要收藏 |
|---|---|---|
| 概览概览 | 读为 | 无 无 |
| 收藏藏藏 | 读为 | 无 无 |
| 化学 | 读为 | 否 是 |
| 查找查找查找查找查找 | 读为 | 否 是 |
| 数数 | 读为 | 否 是 |
| 合计合计 | 读为 | 否 是 |
| 搜索搜索 | 读为 | 无 无 |
| 插入插入 | 写写 | 否 是 |
| 更新更新更新 | 写写 | 否 是 |
| 删除删除删除 | 写写 | 否 是 |
| 保存保存 | 写写 | 否 是 |
| 创建集合 | 写写 | 否 是 |
| 浮点数 | 写写 | 否 是 |
任何其它的调 Action MongoDB inconnue. tables, execute, list, object 和 upload 属于其他提供者。
id 可能是字符串
以 24 字符串 书写的身份识别符, 将转换成 对象 , 不论在哪里 : 直接对等 , $in, $nin 和 $ne。 JSON - 出 find,以一个形式, 回到一个 update - 中间没有你的演员
const [order] = await db.run({ action: "find", collection: "orders", options: { limit: 1 } });
// order._id arrived as a string; it goes back as one
await db.run({
action: "update",
collection: "orders",
filter: { _id: order._id },
update: { $set: { status: "shipped" } },
});order = db.run(action="find", collection="orders", options={"limit": 1})[0]
# order["_id"] arrived as a string; it goes back as one
db.run(
action="update",
collection="orders",
filter={"_id": order["_id"]},
update={"$set": {"status": "shipped"}},
)五个操作员被拒绝
$where, $function 和 $accumulator 运行中 JavaScript 数据库内部; $out 和 $merge 写作,但您所看的不在此处。 全部五人被拒绝 find, count, update, delete 和 aggregate,通过检查过滤器或你发送的管道。
await db.run({ action: "find", collection: "users", filter: { $where: "this.age > 30" } });
// Error: find : l'operateur $where n'est pas autorise.db.run(action="find", collection="users", filter={"$where": "this.age > 30"})
# IaGenifyError: find : l'operateur $where n'est pas autorise.强制实施的伤口
| 事 事 事 | 限制 |
|---|---|
aggregate 结果结果结果结果结果结果 | 500份文件 |
aggregate 和 count 寿命期限 | 30秒30秒 |
insert 批批批次 | 1至500份文件 |
overview | 30个藏书、25个字段、每个样本1个样本 |
schema | 20个最近文件,150个领域 |
写入时拒绝打开空过滤器
更新并删除时没有过滤器会触动每个文档, 所以它们会停止, 除非您添加全部 : 正确 。 读者没有这样的保护 。 查找上的空过滤器是一个普通查询 。
保留连接
每1个客户1个客户 URI 持有并重新使用电话,所以第二个 run() 不再连接。 A URI 更改是一个新的连接, 即旋转密码, 新的主机, 但它不会继承旧的连接 。
系统收藏被过滤出
collections 和 overview 任何外漏在 system. 名称空间。 你看到的是您放在那里的东西。