With the new 3.0 Node SDK out, will SDK 2.6 be supported anymore?

Will you continue to update SDK 2.6 with bug fix or you are only supporting 3.0 now?
Cause I found some bug on the sub document api of 2.6, like:

Querying for “get” and “exists” of the same path is not supported. it screw up the response.

Trying to remove a non existing path, fail the whole command stream.
Isn’t there a way to remove a sub document without checking if it exist before?

Hey @00christian00,

We will continue to support the 2.x releases of the SDKs for quite a while. I believe the expectation is that the 2.x clients will reach end-of-life after 12-18 months.

Cheers, Brett

Thanks @brett19.
Should I report the bug above or that is the expected behaviour?

Hey @00christian00,

Would you be able to explain in better detail the behaviour you are seeing vs. expecting? Note that get and exists operations on the same path is not intended to be used, since exists is a direct subset of the get operation (exists is exactly a get operation which does not return the value).

Cheers, Brett

Fine if it is not supported, I found the workaround.
It is strange when you first use the sub doc api to use the same operation for both because the api report an error if you use the get operation on a non existing path.

The second bug instead is more serious.
When I use the “remove” operation if that path is missing it aport the all the operations.
For example I have a Json like this:

If I do a remove on on the path “guest” and upsert a field email it works fine the first time. But it fail the second time because the path “guest” is not existing anymore and it doesn’t even do the upsert, working like a transaction.
Can we have a remove that doesn’t fail if the path is not existing?

Hey @00christian00,

Unfortunately the sub-document mutation operations are executed atomically, and because of this if any portion of the operations list is not able to succeed, the entire operation will fail. One option may be to use an upsert of a null value or some other form of additive operation which is guaranteed to succeed. Alternatively you could perform a get and subsequent CAS replace on the whole document.

Cheers, Brett

It’s not something that can be implemented on the sdk side right?
Upserting with a null value does remove the field?

I think Brett is suggesting to always do an upsert(path, null) followed by a remove (path), in that order, in the same Sub-Document mutation. The upsert will make sure the path always exists so that the subsequent remove always succeeds.

Oh, I didn’t think of this. Thanks!