MongoDB: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 15: | Line 15: | ||
So the data table might contain columns named B150020221, B150020222, etc., with unique values for each row; and the metadata table would contain a list of strings, i.e., B150020221 = "mean of variable 1", B150020222 = "variance of variable 1", etc. | So the data table might contain columns named B150020221, B150020222, etc., with unique values for each row; and the metadata table would contain a list of strings, i.e., B150020221 = "mean of variable 1", B150020222 = "variance of variable 1", etc. | ||
=Reset= | |||
Reset with Mongodb, now August 2016, here's what we're doing: | |||
[[Scapy/Wifi Database]] - storing wifi data in a MongoDB instance | |||
[https://pymodm.readthedocs.io/en/latest/getting-started.html#installation] - to help get going, use Python pymodm module | |||
=Flags= | =Flags= | ||
Revision as of 19:20, 31 August 2016
Getting Started
Install
Was able to install this ok with Homebrew http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
First Project with Python and MongoDB
http://docs.mongodb.org/ecosystem/tutorial/write-a-tumblelog-application-with-flask-mongoengine/
MongoDB Design Patterns
So far, one of the more useful design patterns I've come up with for MongoDB tables is to always implement tables in pairs: one table to hold data, one table to hold metadata. This allows you to optimize for storage by using shorter keys, numerical codes, etc., but also store the "full name" for that information.
So the data table might contain columns named B150020221, B150020222, etc., with unique values for each row; and the metadata table would contain a list of strings, i.e., B150020221 = "mean of variable 1", B150020222 = "variance of variable 1", etc.
Reset
Reset with Mongodb, now August 2016, here's what we're doing:
Scapy/Wifi Database - storing wifi data in a MongoDB instance
[1] - to help get going, use Python pymodm module