Skip to content

unexpected result for $filter by _id #51

@satadhi4alumnux

Description

@satadhi4alumnux

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions