db.collection.countDocuments
. Ver la respuesta de Xavier Guihot para una mejor solución.
find
no devuelve un valor booleano, devuelve un cursor. Para verificar si ese cursor contiene algún documento, use el método de conteo de cursores.
if db.mycollection.find({'UserIDS': { "$in": newID}}).count() > 0
.
Por cierto:¿newID es una matriz? Cuando no lo es, no debe usar el $in
-operador. Simplemente puede hacer find({'UserIDS': newID})