Details
-
Bug
-
Resolution: Duplicate
-
Minor
-
3.0.6
-
None
-
None
-
1
Description
MutateIn Upsert/Insert with a null property value hits the wire, and then fails.
Here is a reproduction I ran into while testing Upsert-and-remove. The commented code works. The final MutateIn throws.
[Fact]
|
public async Task Upsert_and_remove_when_inserting() |
{
|
var collection = await _fixture.GetDefaultCollection().ConfigureAwait(false); |
var documentKey = nameof(Upsert_and_remove_when_inserting) + Guid.NewGuid().ToString(); |
var sampleDoc = new {foo = "bar"}; |
var insertResult = |
await collection.InsertAsync(documentKey, sampleDoc, opts => opts.Expiry(TimeSpan.FromSeconds(30))); |
////var mutateInResult = await collection.MutateInAsync(documentKey, specs => |
//// specs.Upsert("xattr1", string.Empty, isXattr: true, createPath: true) |
//// .Remove("xattr1", isXattr: true) |
//// .SetDoc(sampleDoc)); |
/// |
|
var result = await collection.MutateInAsync(documentKey, specs => |
specs.Insert("bar", (object)null)); |
|
}
|