title: $in requires an array as a second argument, found: missing
body: <p>can anybody please tell me what am i doing wrong?</p>
  
  <p>db document structure:</p>
  
  <pre><code>{
      "_id" : "module_settings",
      "moduleChildren" : [
          {
              "_id" : "module_settings_general",
              "name" : "General",
          },
          {
              "_id" : "module_settings_users",
              "name" : "Users",
          },
          {
              "_id" : "module_settings_emails",
              "name" : "Emails",
          }
      ],
      “permissions” : [
          "module_settings_general",
          "module_settings_emails"
      ]
  }
  </code></pre>
  
  <p>pipeline stage:</p>
  
  <pre><code>{ $project: {
      filteredChildren: {
          $filter: {
             input: "$moduleChildren",
             as: "moduleChild",
             cond: { $in : ["$$moduleChild._id", "$permissions"] }
          }
      },
  }}
  </code></pre>
  
  <p>I need to filter "moduleChildren" array to show only modules which ids are in "permissions" array. Ive tried "$$ROOT.permissions" and "$$CURRENT.permissions" but none of them is working. I always get an error that $in is missing array as argument. It works when i hardcode the array like this: <code>cond: { $in : ["$$moduleChild._id", [“module_settings_general", "module_settings_emails”]] }</code> so it seems the problem is in passing of the array.
  Thanks for any advices!</p>