How can I add a $gt to an object "selectorObject["key"] = { $gt: value };"?

Thanks for your help

EDIT: the solution no. 1 works if it’s an UPDATE (means there is a document with those selections existing when executing the UPSERT but it fails when there is no document and basically an INSERT is executed. Error message on the later part is: MongoError: The dollar ($) prefixed field ‘$gt’ in ‘key.$gt’ is not valid for storage.

The .dot notation is just another way of writing solution no. 1 and thus fails as well.