LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

[QUESTION] Is Upsert supposed to work like it does currently?

Open koddek opened this issue 8 months ago • 2 comments

Currently in the latest LiteDB 5.0.2.1, On Mac, .NET 9, Upsert only returns 'true' when inserting a new document in a new document collection. Otherwise it returns false even if it successfully adds or update a document in an existing document collection.

koddek avatar May 07 '25 06:05 koddek

I thought it was a bit strange as well when I first tried using the upsert function.

If I were to change this, I would return a struct object which contains added and updated counts.

alfflasymphonyx21 avatar Jun 20 '25 20:06 alfflasymphonyx21

There's this item from 5!!! years ago when it was said that documentation should be updated - https://github.com/litedb-org/LiteDB/issues/1410 - but that appears not to be the case yet.

surgicalcoder avatar Jul 06 '25 21:07 surgicalcoder