How can I use a function to give me the rids of objects?

203 Views Asked by At

I would like to look up the rids of some objects and capture them in an array of strings for reference or further use elsewhere.

1

There are 1 best solutions below

2
On

We can answer this easily, we can pass the object set of interest as an argument into the function. Then the following will return their rids. We can then return them or write them to an object property. Note that this will not fetch any rids for any objects I only just created in the same function.

myObjectSet.allAsync().then(objs => objs.map(x => x.rid!))