Getting document key with lookup via index

Is there any way to retrieve the original document key when looking up a record via index? My use case is as follows…

I have a User record with key 1001. I perform a lookup using the email address (which was indexed) and the record is returned to me, but I need to also know the original document key used to insert the record (which in this case is 1001). for my particular use case, the key is not part of the actual record / document.

FYI… if it helps, I am using the Java SDK.


select meta(bucket_name).id, * from bucket_name
wou get you the document ID.

Great, thanks… that works perfectly!