Open jrouaix opened 6 years ago
@jrouaix the problem is you are trying to iterate on Test
collection and do upsert, obviously when there is no document exists it insert nothing, your query should be like this:
// do not iterate here => db.Query<TEST>()
db.Query()
.Upsert(_ => new Test { _key = name },
_ => new Test { _key = name },
(_, old) => new { updated = AQL.DateNow() })
// and specify collection
.In<Test>()
.Execute();
and please read this answer for more understanding how upsert works: https://stackoverflow.com/questions/39502158/arangodb-net-upsert-always-insert/39543181#39543181
It's working ! thank you very much ! Do you plan to have an ExecuteAsync() method in the next release ?
Hello, i'm really sorry to bother, but after a few hours struggling, I can't have a simple upsert working.![image](https://user-images.githubusercontent.com/2705498/34693068-a6f3484a-f4c2-11e7-9443-dc05c7000aaa.png)
The update part is working when documents are already created but if not, nothing is inserted.
Any idea ? Is this a bug or there is something I didn't do well ?