marklogic-community / Corona

Community REST API for MarkLogic
Other
37 stars 9 forks source link

Destroy should return uris of deleted documents #3

Closed dscape closed 13 years ago

dscape commented 13 years ago

In the previous version we were retuning uris only, now only metadata is returned:

  Nuno-Jobs-MacBook-Pro:nuvem njob$ NODE_ENV=development node test/json/destroy.js 
  { method: 'PUT',
    headers: { 'content-type': 'application/json' },
    uri: 'http://admin:admin@localhost:4380/json/store/i_bulk_custom_query',
    body: '{"dino":false}' }
  { method: 'PUT',
    headers: { 'content-type': 'application/json' },
    uri: 'http://admin:admin@localhost:4380/json/store/are_bulk_custom_query',
    body: '{"dino":false}' }
  { method: 'PUT',
    headers: { 'content-type': 'application/json' },
    uri: 'http://admin:admin@localhost:4380/json/store/dino_bulk_custom_query',
    body: '{"dino":"RWAR"}' }
  { method: 'DELETE',
    headers: { 'content-type': 'application/json' },
    uri: 'http://admin:admin@localhost:4380/json/store?customquery=%7B%22equals%22%3A%7B%22key%22%3A%22dino%22%2C%22value%22%3A%22RWAR%22%7D%7D&bulkDelete=true' }
  ✗ 

    bulk_custom_query
      ✗ ok
        » expected {
      deleted: 1,
      numRemaining: 0,
      uris: [ '/dino_bulk_custom_query' ]
  },
    got  {
      meta: { deleted: 1, numRemaining: 0 }
  } (==) // destroy.js:46
  ✗ Broken » 1 broken (0.309s)
ryangrimm commented 13 years ago

By default only the metadata about the delete request is returned. If you'd like the URI's that were deleted to also be included just add a include=uris into the request.

dscape commented 13 years ago

Thanks, will do that in one of the tests, leave the other unchanged :)

On Tue, Sep 6, 2011 at 4:29 PM, isubiker reply@reply.github.com wrote:

include=uris