Barry
(Barry)
September 1, 2025, 7:10am
1
I was trying to run one transaction instead of multiple queries but it didn’t work. Then I came across this post and it says it is impossible:
Tricky question which perhaps has the answer “that’s not possible”:
Say you have a transaction with the 1st operation being a “find” operation. Then you want to run a second operation which is also a “find”, but you want to use part of the result of the 1st operation (e.g. “objectId” in the 1st item of that result) in the WHERE CLAUSE of the second operation… is this possible?
Our specific use case: user logs in and we want to run a transaction where we find an object they own in one table… an…
Basically what it mentioned is exactly what I was trying to do:
Run query A
Get the objectId property from the first object from the result of query A
Use (2) in the second query
So is there any way that I can do this in one query?
Hi @Barry ,
Unfortunatelly this is still not supported. Mark explained this with details in the refferenced topic:
At the time when the where clause is composed for the second query, the result from the first one is not available. The where clause cannot include a reference to a result, it should be a complete scalar value by the time the entire sequence of operations is sent to the server in the transaction.
Regards, Andriy