I'm having difficulty understanding how arrays work in the Mongo shell. It seems that whenever I create an array the "typeof" is still object and I when I try to run the following:
db.collection.find(test: {$type : 4})
I get no results, even though previously I had inserted an array into the collection using the following:
db.collection.insert({"test" : ["1", "2","3]})
Is this something I am not understanding about JSON or BSON? Are arrays still objects and if so how do you test if the object you have is an array? Ultimately I am hoping to split some strings in my database into arrays of strings but when I tested the type afterwards to ensure my code was working I was confused to find no type = array, even though they appear to be there when I look at findOne()!