team4909 / 2018-Core

2018 Scouting Platform
MIT License
10 stars 3 forks source link

MongoDB Aggregation Queries $addFields Operator #9

Closed roshanr10 closed 6 years ago

roshanr10 commented 6 years ago

MongoDB is used to store and query the data we collect.

However, the $addFields aggregation method only exists in MongoDB v3.4+, which requires 64 bit. Unfortunately, Raspbian is 32 bit (for backwards compatibility with Pi 1/2), and the latest version we can get via apt is v2.X.

I'd like to investigate if we can use do something with the $project operator to accomplish something similar. If we can't, we'll have to look for alternative approaches to process the data on the Pi.

roshanr10 commented 6 years ago

Tested, $project can be used in a similar fashion to $addFields; only thing is the titles of all the fields have to mentioned in each projection stage, but that is a minimal issue to deal with as compared to trying to compile a 64 bit Pi OS, run a server on each laptop, or more custom code.

Last Year's Queries: https://github.com/FRCteam4909/The-Green-Alliance-Server-2017/blob/master/config/views.js