cosmosdb仿真器未给出任何结果 [英] cosmosdb emulator not giving any results

查看:70
本文介绍了cosmosdb仿真器未给出任何结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么在查询cosmos数据库时会发生这种情况,即使对于

,它也不会显示任何文档

SELECT * FROM c

,但显示了RU.但是如果我使用任何过滤器,它在文档"选项卡中的文档"选项卡上都可以正常工作,但它也可以工作,但不适用于SQL查询.

我已经添加了案例和比例尺&的屏幕截图设置.

我需要重新安装azure cosmosdb仿真器吗?如果是的话,有什么办法可以保留我的模拟器旧数据

解决方案

这看起来像是模拟器的错误.

我能够重新创建您的问题.仅当未提供分区键并且您试图进行跨分区查询时,这种情况才会发生在分区集合中.

如果在浏览器中打开网络"选项卡,则实际上可以看到以下消息:

网关无法直接提供所提供的跨分区查询.这是所有新客户端都将知道如何妥善处理的第一次(内部)异常.将跟踪此异常,但是除非您看到它冒了气泡作为例外(仅在较旧的SDK客户端上会发生),那么您可以放心地忽略此消息"

但是,您也可以看到在另一个请求中返回的结果,只是看不到它们.我看起来前端只是无法正确处理第一个错误,但我不确定.

I have no idea why this happening while querying the cosmos database it won't show any document not even for the

SELECT * FROM c

but the RU's is shown. but it works fine with the Documents tab in documents tab if I'm using any filter then also it working but it won't work for SQL query.

I have added the screenshot for both the case and also the scale & setting.

Do I need to reinstall the azure cosmosdb emulator? if yes then, is there any way to retain my old data of emulator

解决方案

This looks like a bug with the emulator.

I was able to recreate your issue. This only happens with partitioned collections when the partition key isn't provided and you're trying to do a cross partition query.

If you open your Network tab in the browser you can actually see this message:

"The provided cross partition query can not be directly served by the gateway. This is a first chance (internal) exception that all newer clients will know how to handle gracefully. This exception is traced, but unless you see it bubble up as an exception (which only happens on older SDK clients), then you can safely ignore this message"

However you can also see your results returned in another request, they are just not visualised. I looks like the front end is just not handling this first error properly but I can't know for sure.

这篇关于cosmosdb仿真器未给出任何结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆