Q:

Mongodb $match and $isArray

For this ample of data I want to match only the field that are array. But I would like to have the $match out of the project. 
This is the data sample:
/* 1 */
{
    "_id" : ObjectId("5df8b596400289966e77e268"),
    "fieldIDA" : "1496461ahu-45196tfvj",
    "fieldIDB" : "4446rarr21-vau15ar6a"
}

/* 2 */
{
    "_id" : ObjectId("5df9ee6014585733585abde6"),
    "fieldIDA" : "78a24da5ea-a0a84tf5t",
    "fieldIDB" : [ 
        "17a7a61a78-4649atfvj", 
        "149648a6a1-777777fvj", 
        "4846131prv-45aeda8vj"
    ]
}

/* 3 */
{
    "_id" : ObjectId("5df9ee6014585733585abde9"),
    "fieldIDA" : null,
    "fieldIDB" : "7a25rayfg7-t69468a8v"
}

/* 4 */
{
    "_id" : ObjectId("5df9ffe714585733585ac5b8"),
    "fieldIDA" : [ 
        "4946465434-vuhfyfuog", 
        "198fdyufu5-4654d43dc", 
        "aeadad596a-aead82a2a"
    ],
    "fieldIDB" : [ 
        "17a7a61a78-4649atfvj", 
        "149648a6a1-777777fvj", 
        "4846131prv-45aeda8vj"
    ]
}

This is what I try but it return an syntax error on the line of the $match honestly I tried every syntax I could think of or look at on the mongo doc : 
> db.getCollection('Test').aggregate([ {
>     $project:{
>     "item":"$fieldIDA" 
>     }}
>     {$match : { $isArray: {"$item"} }:true}, ])

I know it's a simple request but I don"t find how to make it work. 

A:

You can try one of these :
db.Test.find({ "fieldIDA" : { $type: "array" } })

Or this :
db.Test.aggregate([{$project : {fieldIDA: 1, _id:0}},{$match : { "fieldIDA" : { $type: "array" } }}])

Ref : $type

