Last active
August 3, 2018 21:14
-
-
Save npentrel/41ca383e43967038a9622e38b2eebd59 to your computer and use it in GitHub Desktop.
Use aggregation expressions in queries with $expr - Insert operation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.accounts.insertMany([ | |
{"_id": 1, "credits": 5000, "expenses": [2000, 2000]}, | |
{"_id": 2, "credits": 4000, "expenses": [1000, 4000, 2000]}, | |
{"_id": 3, "credits": 3000, "expenses": [1500, 750]}, | |
{"_id": 4, "credits": 2000, "expenses": [2500, 750]} | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment