Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected result for $filter by _id #51

Open
satadhi4alumnux opened this issue Dec 8, 2022 · 0 comments
Open

unexpected result for $filter by _id #51

satadhi4alumnux opened this issue Dec 8, 2022 · 0 comments

Comments

@satadhi4alumnux
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant