Cosmosdb MongoDB API聚合方法不起作用 [英] Cosmosdb mongodb api aggregate method doesn't work
问题描述
我正在使用带有MongoDB API的Cosmos DB 和 当我使用聚合管道对文档进行计数时,结果不正确且不稳定.
实际上,我比较了"aggregate()"与"find()"一起使用并且即使两个查询都是相同的,这些结果也根本不匹配.
环境信息:
*使用分片(分区数据)
* MongoDB聚合管道已启用
* MongoDB 3.4写入协议(版本 5)
例如
1. find()的结果.
find()方法可正确检索文档.
解决方案
您好TianzHong9045,
"我们现在正处于MongoDB聚合管道的公开预览中.您可以在Azure Portal中的Cosmos DB MongoDB API帐户的预览功能"页面上启用它.此处描述了受支持的语法构造:https://aka.ms/mongodb-feature-support"
汇总管道 >
如果仍然存在异常,可以请您导航至以下文档,并根据所声明的内容确认语法: MongoDB API对MongoDB功能和语法的支持
谢谢
迈克
I am using Cosmos DB with MongoDB API and when I use aggregation pipeline to count documents, the results are incorrect and unstable.
Actually I compared "aggregate()" with "find()" and these results didn't match at all even the both queries are equivalent.
Environment info:
* using sharding (partition data)
* MongoDB Aggregation Pipeline is enabled
* MongoDB 3.4 write protocol(version 5)
For instance
1. the result of find() .
find() method retrieved a document correctly.
db.datastore.find({header_channel_id:"bckr419gqoomm42jlsng"}).limit(1) { "_id" : "object-bckr61jfuq8jml2nu950", "header_channel_id" : "bckr419gqoomm42jlsng", "header_channel_protocols" : [ ], "header_session_id" : "session-xyz", "header_timestamp" : NumberLong(1), "header_mimetype" : "text/plain", "location_latitude" : null, "location_longitude" : null, "location_altitude" : null, "created_at" : NumberLong("1529459462968360566"), "payload" : BinData(0,"aG9nZQ=="), "payload_size" : NumberLong(4) }
解决方案Hi TianzHong9045,
"We are now in public preview with MongoDB aggregation pipeline. You can enable it on Preview Features page for your Cosmos DB MongoDB API account in Azure Portal. The supported syntax constructs are described here: https://aka.ms/mongodb-feature-support"
If there are still anomalies, can you please navigate to the below documentation and confirm your syntax against what is stated: MongoDB API support for MongoDB features and syntax
Thanks,
Mike
这篇关于Cosmosdb MongoDB API聚合方法不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
相关文章
- MongoDB聚合排序不起作用;
- cosmosdb mongo api对于某些命令不起作用;
- 聚合匹配的项目在 mongodb 中不起作用;
- 查找聚合中的管道在 mongodb 中不起作用;
- Web API发布方法不起作用;
- Web API Post 方法不起作用;
- mongodb:到期不起作用;
- MongoDB allowDiskUse不起作用。;
- mongodb覆盖索引不起作用?;
- 确保索引不起作用 - MongoDB;
- dropDups true不起作用mongodb;
- imgur api 不起作用;
- MongoDB唯一索引不起作用;
- InsertMany在mongodb中不起作用;
- $elemmatch 在 MongoDB 中不起作用;
- Spring数据MongoDB示例不起作用;
- AJAX方法不起作用;
- .scrollLeft()方法不起作用;
- SelectedIndexChanged方法不起作用;
- 替换方法不起作用;
- .unlist方法不起作用;
- ToTitleCase方法不起作用;
- 页面方法不起作用;
- Web方法不起作用;
- ArrayList 方法不起作用;
其他开发语言最新文章
- 成功安排的软件保护服务,以便重新启动:原因:RulesEngine。;
- 如何解决“我们很抱歉......”但您的计算机或网络可能正在发送自动查询。为了保护我们的用户,我们目前无法处理您的请求。“;
- golang无效操作:type interface {}不支持索引;
- 如何在Visual Studio 2019中创建EXE文件;
- 关于“Add-AppxPackage”的问题powershell命令;
- Windows x64 RabbitMQ安装错误与Erlang环境var(ERLANG_HOME);
- CMAKE_C_COMPILER不是现有编译器工具的完整路径;
- 在Go中将float64转换为int;
- 显示设置 - 屏幕分辨率 - 无法从远程会话更改;
- 使用Twitter登录时出错;