Details
-
Bug
-
Resolution: Unresolved
-
Major
-
3.0.0-rc
-
None
-
1
-
SDK22: Docs,Publish,Pipeline, SDK24: Txnλ+Func,TxnFormer,CoC
Description
When you do a collection.get(<key>, GetOptions(with_expiry=True)), you expect that there will be a property on the GetResult that is returned with the expiry, and when you do result.content_as[dict] you will see the entire document (and nothing else). If you instead ask for a projection collection.get(<key>, GetOption(project=["a", "b"], with_expiry=True)), you'd expect the expiry like before, and the content_as to give you just the projection.
In fact, the former (thanks to a recent hack) is what happens. But the latter case gives you the projection, plus the expiry field from the xattrs ("$document.exptime: xxx")
In fact this is a bit tricky under the covers. The GetResult realized it was created from a SubdocResult, and needs to do a bit of work to get what you'd expect for a GetResult. Perhaps we can rethink what I did? Doing things close to GA, I did the most expedient thing I could do, and probably with a bit of thought, maybe a somewhat more clever ContentProxy, we can clean this up, and eliminate the xattr field from the result of a content_as.
Also... should we be more clever about how we return results to show which are xattrs? Worth pondering.