I\'ve written a function to convert an object to an array where each element of the array contains the ID of the object. This currently works well with the following code: