Question: Consider the transactions collection of documents below, where each document represents one transaction made on a stock exchange: either buying or selling stocks. { date:

Consider the transactions collection of documents below, where each document represents one transaction made on a stock exchange: either buying or selling stocks.
{
"date": {"$date": 1325030400000},
"amount": 1197,
"transaction_code": "sell",
"symbol": "nvda",
"price": "12.73",
"total": "15241.40"
},
{
"date": {"$date": 1465776000000},
"amount": 8797,
"transaction_code": "buy",
"symbol": "nvda",
"price": "46.53",
"total": "409401.22"
},
{
"date": {"$date": 1472601600000},
"amount": 6146,
"transaction_code": "sell",
"symbol": "ebay",
"price": "32.11",
"total": "197384.99"
},
{
"date": {"$date": 1101081600000},
"amount": 253,
"transaction_code": "buy",
"symbol": "amzn",
"price": "37.77",
"total": "9556.92"
},
{
"date": {"$date": 1022112000000},
"amount": 4521,
"transaction_code": "buy",
"symbol": "nvda",
"price": "10.76",
"total": "48659.83"
},
{
"date": {"$date": 936144000000},
"amount": 955,
"transaction_code": "buy",
"symbol": "csco",
"price": "27.99",
"total": "26732.49"
}
If this query was executed on this collection:
db.transactions.find({ $and: [{transaction_code":"buy"},
{$and: [{ price: { $lte: 45.50}},{ price: { $gte: 15.50}}]}]
})
How many documents would be returned?
Group of answer choices
2
4
3
1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!