Creating a list with ListAppend fails


If I try and create a list using ListAppend I get a KeyNotFound status in the result, even if the third parameter is true.

bucket.ListAppend("list", "value", true);

The same appears to be true for equivalent methods for sets and maps.

I can create lists, sets and maps using Insert without any problem.

bucket.Insert("list", "[]");
bucket.ListAppend("list", "value", false);

Am I missing something, or is this functionality broken?


Hi @mark_watts

Thanks for the bug report. It does indeed seem like a bug in the SDK. Internally we use the subdoc API to perform the actions and instead of the bool being used to create the document if it doesn’t exist, it’s used to create the array within the document if missing.

I’ve created ticket NCBC-1694 to track and fix.


Thanks @MikeGoldsmith, I’ll use the two-step workaround until the next version of the SDK is out.