避免取回DocumentDb系统属性 [英] Avoid getting back DocumentDb system properties

查看:88
本文介绍了避免取回DocumentDb系统属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,返回一个文档

I have a query which returns one document

从根目录选择*

上面的查询还返回了额外的系统属性,例如_ts,_self,_etag等.我不希望我的查询返回这些额外的属性.我想要*,因为我不想指定要选择的列.

Above query also returns extra system properties like _ts, _self, _etag etc. I do not want my query to return those extra properties. And I want * as I do not want to specify columns to select.

我正在sproc中运行此查询.还有什么更好的方法可以不返回系统属性?

I am running this query in sproc. Any better way to not return system properties?

推荐答案

我不知道有什么办法.获取它们不会占用大量资源,您始终可以忽略它们.或者,您可以使用以下代码在文档到达后立即将其删除:

I don't know of any way to do that. It will not take up a significant amount of resources to get them and you can always just ignore them. Alternatively, you can delete them as soon as the document(s) arrive using code like this:

for (var _i = 0, var _len = resultsArray.length; _i < _len; _i++) {
  var row = resultsArray[_i];
  delete row._ts;
  delete row._self;
  delete row._etag;
}

这篇关于避免取回DocumentDb系统属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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