Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.0.0-alpha2
-
None
-
1
Description
For the LCB V3 API (AKA libcouchbase v2), PYCBC implements a subdoc upsert with fulldoc insert by setting CMDSUBDOC_F_INSERT_DOC on the lcb_CMDSUBDOC::cmdflags structure, and adding an upsert item into the lcb_CMDSUBDOC::specs structure.
In LCB_V4 API, there is no direct access to setting the CMDSUBDOC_F_INSERT_DOC option without calling lcb_subdocops_fulldoc_add. However, this also chooses the LCB_SDCMD_SET_FULLDOC operation for a given item in the spec list. In response, libcouchbase returns a LCB_SUBDOC_VALUE_CANTINSERT error in this case ("Subdocument operation would invalidate the JSON")
If I import the internal structure information of lcb_CMDSUBDOC and attempt to set CMDSUBDOC_F_INSERT_DOC directly and use an SD.upsert command in the spec as before it works as before.
Should setting CMDSUBDOC_F_INSERT_DOC and adding an upsert operation to the specs be functionally equivalent to using lcb_subdocops_fulldoc_add, even though the opcode number set and sent is different?
If so, what might be causing the error?
If not, is this functionality now deprecated?
Attachments
Issue Links
- relates to
-
PYCBC-584 Support fulldoc insert with subdoc upsert with LCB V4 API
- Resolved