I'm trying to iterate over a result, but getting a...
# prisma-client
d
I'm trying to iterate over a result, but getting an error:
Type 'JsonObject' must have a '[Symbol.iterator]()' method that returns an iterator
Code in question (mongodb):
const res = await db.tweet.aggregateRaw({
pipeline
});
for (const tweet of res);
a
Hey David 👋, Could you send a sample of the data that’s in
res
? I think
aggregateRaw
returns an object, not an array, which means you can’t loop over it with a
for of
style loop.