A
A
Alexey2020-08-21 20:58:03
MongoDB
Alexey, 2020-08-21 20:58:03

Is such an expression valid for Mongo Db?

Good afternoon, is such an expression valid for inserting an element into a database with variable values ​​of the chat array (activeChat) and the messages object (msg) for Mongo Db?

this.db.chat.update({
        $let: {
          vars: {updchat: activeChat, updmessage: msg},
          in: {$push: ["$$updchat", "$$updmessage"]}
        }
      })

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question