问题
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