node-simple-odata-server
node-simple-odata-server copied to clipboard
unexpected result for $filter by _id
Hello, Can you please explain they need of code line,
if (Object.prototype.hasOwnProperty.call(queryOptions.$filter, '_id')) {
sAdditionIntoContext = sAdditionIntoContext.length > 0 ? '(' + sAdditionIntoContext + ')/$entity' : '/$entity'
out['@odata.context'] = cfg.serviceUrl + '/$metadata#' + req.params.collection + sAdditionIntoContext
if (result.length > 0) {
for (const key in result[0]) {
out[key] = result[0][key]
}
I check in the OData docs, but I don't see the need of this. Can you please explain the reason behind this logic ?