Answers for "category tree mongodb"

0

category tree mongodb

var categories = db.getSisterDB("catalog").categories;
categories.insert([{
    "name": "electronics"
  , "parent": "/"
  , "category": "/electronics"
}, {
    "name": "embedded"
  , "parent": "/electronics"
  , "category": "/electronics/embedded"
}, {
    "name": "cases"
  , "parent": "/"
  , "category": "/cases"
}, {
    "name": "big"
  , "parent": "/cases"
  , "category": "/cases/big"
}, {
    "name": "small"
  , "parent": "/cases"
  , "category": "/cases/small"
}]);

var products = db.getSisterDB("catalog").products;
products.insert({
    "name": "Arduino"
  , "cost": 125
  , "currency": "USD"
  , "categories": ["/electronics/embedded"]
});
Posted by: Guest on May-02-2021

Code answers related to "category tree mongodb"

Browse Popular Code Answers by Language