marklogic / node-client-api

The MarkLogic Node.js Client API
https://docs.marklogic.com/jsdoc/index.html
Apache License 2.0
51 stars 45 forks source link

fragmentScope() doesn't take any effect on geoSpatialRegion #276

Closed ayuwono closed 8 years ago

ayuwono commented 8 years ago

It seems that fragmentScope is not taking any effect. When I put properties as the value, it's still returning the documents although the documents don't have any properties

Shouldn't it return no document?

    dbWriter.documents.query(
      q.where(
        q.geospatialRegion(
          q.geoPath('/root/item/point'),
          'equals',
          q.point(0, -66.09374),
          q.geoOptions(['tolerance=1']),
          q.fragmentScope('properties')
        )
      )
    )
ehennum commented 8 years ago

Hmmm. The Node.js API is sending the qualification to the REST API.

ehennum commented 8 years ago

The root cause is in the Search API.

ehennum commented 8 years ago

We should add tests on the Search API to confirm that the fragment scope from geospatial queries is getting passed in. Previously, only the fragment scope from the options for geospatial queries was passed.

ayuwono commented 8 years ago

Added test on nodejs-documents-query-region.js