Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-4549

make CAPI CRUD return $flags and $expiration in replies [was: emitting a doc into the view brings $flags and $expiration]

    Details

      Description

      (update by alk):

      As can be seen in comments we think we should always expose $flags and $expiration in json docs we expose either via CAPI CRUD or view map/reduce. So going to change CAPI CRUD code instead.

      was:

      (originally reported at http://www.couchbase.org/forums/thread/magic-flags-and-expiration-vars-show-view-not-doc)

      i noticed that if you query a view that emits the document, you get properties like $flag and $expiration, but if you query the http interface for the document url itself, it only shows _rev and _id, not any of the dollar sign magic variables. is there a reason behind that difference?
      curl "http://192.168.96.128:8092/default/_design/test/_view/all?key=%22test%2Fquery-1324052106.5247-11152826%22"
      {"total_rows":39,"rows":[
      {"id":"test/query-1324052106.5247-11152826","key":"test/query-1324052106.5247-11152826","value":{"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","$flags":0,"$expiration":1324055706,"foo":"bar"}}
      ]}
      curl "http://192.168.96.128:8092/default/test%2Fquery-1324052106.5247-11152826"

      {"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","foo":"bar"}
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        ingenthr Matt Ingenthron created issue -
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        Matt, do you think we should instead fix CAPI CRUD to add those fields? It feels more natural, because otherwise this information is not available via couch API.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - Matt, do you think we should instead fix CAPI CRUD to add those fields? It feels more natural, because otherwise this information is not available via couch API.
        alkondratenko Aleksey Kondratenko (Inactive) made changes -
        Field Original Value New Value
        Assignee Aleksey Kondratenko [ alkondratenko ]
        Hide
        ingenthr Matt Ingenthron added a comment -

        That was the other thing I'd considered, yeah. I do agree that it makes more sense to have it there too (and actually, I thought it was!) so long as it won't break anything else.

        Show
        ingenthr Matt Ingenthron added a comment - That was the other thing I'd considered, yeah. I do agree that it makes more sense to have it there too (and actually, I thought it was!) so long as it won't break anything else.
        Aliaksey Artamonau Aliaksey Artamonau made changes -
        Assignee Aleksey Kondratenko [ alkondratenko ] Aliaksey Artamonau [ aliaksey artamonau ]
        alkondratenko Aleksey Kondratenko (Inactive) made changes -
        Summary emitting a doc into the view brings $flags and $expiration make CAPI CRUD return $flags and $expiration in replies [was: emitting a doc into the view brings $flags and $expiration]
        Description (originally reported at http://www.couchbase.org/forums/thread/magic-flags-and-expiration-vars-show-view-not-doc)

        i noticed that if you query a view that emits the document, you get properties like $flag and $expiration, but if you query the http interface for the document url itself, it only shows _rev and _id, not any of the dollar sign magic variables. is there a reason behind that difference?
        curl "http://192.168.96.128:8092/default/_design/test/_view/all?key=%22test%2Fquery-1324052106.5247-11152826%22"
        {"total_rows":39,"rows":[
        {"id":"test/query-1324052106.5247-11152826","key":"test/query-1324052106.5247-11152826","value":{"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","$flags":0,"$expiration":1324055706,"foo":"bar"}}
        ]}
        curl "http://192.168.96.128:8092/default/test%2Fquery-1324052106.5247-11152826"
        {"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","foo":"bar"}
        (update by alk):

        As can be seen in comments we think we should always expose $flags and $expiration in json docs we expose either via CAPI CRUD or view map/reduce. So going to change CAPI CRUD code instead.

        was:

        (originally reported at http://www.couchbase.org/forums/thread/magic-flags-and-expiration-vars-show-view-not-doc)

        i noticed that if you query a view that emits the document, you get properties like $flag and $expiration, but if you query the http interface for the document url itself, it only shows _rev and _id, not any of the dollar sign magic variables. is there a reason behind that difference?
        curl "http://192.168.96.128:8092/default/_design/test/_view/all?key=%22test%2Fquery-1324052106.5247-11152826%22"
        {"total_rows":39,"rows":[
        {"id":"test/query-1324052106.5247-11152826","key":"test/query-1324052106.5247-11152826","value":{"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","$flags":0,"$expiration":1324055706,"foo":"bar"}}
        ]}
        curl "http://192.168.96.128:8092/default/test%2Fquery-1324052106.5247-11152826"
        {"_id":"test/query-1324052106.5247-11152826","_rev":"1-00009fddf9213ed70000000d00000000","foo":"bar"}
        Assignee Aliaksey Artamonau [ aliaksey artamonau ] Aleksey Kondratenko [ alkondratenko ]
        Hide
        steve Steve Yen added a comment - - edited

        alk thinks this might be fixed already / raising to Blocker status on his request, so it appears at the top of his list

        Show
        steve Steve Yen added a comment - - edited alk thinks this might be fixed already / raising to Blocker status on his request, so it appears at the top of his list
        steve Steve Yen made changes -
        Priority Minor [ 4 ] Blocker [ 1 ]
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        double checked

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - double checked
        alkondratenko Aleksey Kondratenko (Inactive) made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        farshid Farshid Ghods (Inactive) made changes -
        Labels 2.0-dev-preview-4-release-notes
        farshid Farshid Ghods (Inactive) made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            alkondratenko Aleksey Kondratenko (Inactive)
            Reporter:
            ingenthr Matt Ingenthron
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes