Skip to content

Instantly share code, notes, and snippets.

@albertvolkman
Last active August 29, 2015 13:57
Show Gist options
  • Save albertvolkman/9744340 to your computer and use it in GitHub Desktop.
Save albertvolkman/9744340 to your computer and use it in GitHub Desktop.
Example MondoDB schema
{
_id: '00e8da9b’,
name: 'Kidney Beans',
barcode: '99823883833',
stores: [ # Instances of this product.
{
_id: '98823d',
name: 'Publix',
qty: 30, # Quantity available within store.
price: 1200,
location: '28.595143, -81.373770' # Geolocation of product within store.
},
{
... # Additional stores that carry this product
}
]
}
{
_id: '98823d',
name: 'Publix',
location: '28.595122, -81.373747' # Store location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment