Right now running subqueries via a MatchFunc call isn't supported in Update or Delete queries. This is due to the fact that Badger only allows one iterator on Read/Write transactions.
I have a couple options to allow this:
Start a new transaction for subqueries: I don't like this, because it breaks the isolation level. You'd be reading the previously committed version of records and using that information to update or delete data inside of a transaction. Not really safe IMO.
When a new subquery starts, store the current iterators location, run the subquery, and seek back to that location when the subquery finishes.
1 is obviously easier, but not really an option in my opinion. Currently I'm simple throwing an error if a subquery is attempted in a RW transaction.
Right now running subqueries via a
MatchFunc
call isn't supported inUpdate
orDelete
queries. This is due to the fact that Badger only allows one iterator on Read/Write transactions.I have a couple options to allow this:
1 is obviously easier, but not really an option in my opinion. Currently I'm simple throwing an error if a subquery is attempted in a RW transaction.