Meteor saying an array is an object

Hey guys,

The mistery of tonight is that Meteor is saying that my arrays are actually objects.
This is the log I just got (checking typeof):

> [ 'Lta7fGbYeFSommFsp', 'NjLKPsinSnZDNRvA6' ] 'object'

This is happening inside a publication. This array comes from a Mongo collection.
Bad thing is: I need this array for a further query using $in (which requires an array), and it isn’t working…

Any idea what is going on here?
Thanks!

Yes, all Arrays in javascript are objects by definition in the language specification. To test if something is an array, use Array.isArray

That means your issue with the $in query is probably from something else. Can you post the error and stack trace?

5 Likes