Avoid getting back DocumentDb system properties

纵然是瞬间 提交于 2021-01-28 09:11:01

问题


I have a query which returns one document

Select * from root

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.

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


回答1:


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;
}


来源:https://stackoverflow.com/questions/32281389/avoid-getting-back-documentdb-system-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!