Closed harlev closed 4 years ago
This change will give us the meta data of the queried records, not the meta data of the entire box. I was thinking of having a separate route like /_meta/BOX_ID
which gives us the _count
of all the records in the box with the _createdOn
being the oldest record's created date and _lastUpdatedOn
being the most recent updated date.
I can make it use the /_meta/BOX_ID
route.
But as far as I can tell, what I implemented does give the requested result for the whole box
the _count of all the records in the box with the _createdOn being the oldest record's created date and _lastUpdatedOn being the most recent updated date.
@vasanthv made updates to match your suggestions and comments. Also cleaned up the helper function to be easier to read, and updated README The description at the top of the PR was updated to reflect the final implementation.
Based on requirements in issue https://github.com/vasanthv/jsonbox/issues/47
metadata items will be returned if
_meta/
is appended to the beginning of aGET
request for a box.example:
_meta/box_c6bd37b59afce59b5e2c
The format of the result will be:createdOn
is the earliest creation time of a record in the box.updatedOn
will be included only if there is at least one record with an update. It will be the latest updating time of a record in the boxAlso added a basic test to verify the data coming back for a
_meta
request.