Mongodb
In MongoDB, you do not write SQL, but work with objects ("documents") - you do not need to avoid things, since you never use strings other than data.
However, you need to make sure that you are actually passing strings, not arrays, to the MongoDB API. At least in PHP, passing an array, such as array('$ne' => 1) , will check != 1 and therefore will be just as dangerous as SQL injection. And unfortunately, PHP allows the client to create arrays inside $_POST , etc., simply by providing a field with a name using the PHP array syntax, for example password[$ne] . [A source]
source share