What is the work of field.$ in mongoDB or mongoose

Viewed 29

I was doing a cart API by Express JS and MongoDB. Here a $ is used. Can anyone explain to me what the "cartItems.$" is doing?

      update = {
          "$set": {
            "cartItems.$": cartItem,
          },
        };
0 Answers
Related