- replaced with new images - changed the product image to png for consistency. - changed the names of robots and their SKU.
31 lines
2.0 KiB
JavaScript
31 lines
2.0 KiB
JavaScript
//
|
|
// Products
|
|
//
|
|
db = db.getSiblingDB('catalogue');
|
|
db.products.insertMany([
|
|
{sku: 'Alpha', name: 'Alpha', description: 'Sorry Dave, I cant do that', price: 2001, instock: 2, categories: ['Artificial Intelligence']},
|
|
{sku: 'Ewooid', name: 'Ewooid', description: 'Highly advanced sentient processing unit with the laws of robotics burned in', price: 200, instock: 0, categories: ['Artificial Intelligence']},
|
|
{sku: 'HPTD', name: 'High-Powered Travel Droid', description: 'Large mechanical workhorse, crude but effective. Comes in handy when you are lost in space', price: 1200, instock: 12, categories: ['Robot']},
|
|
{sku: 'UHJ', name: 'Ultimate Harvesting Juggernaut', description: 'Extraterrestrial Vegetation Evaluator', price: 5000, instock: 10, categories: ['Robot']},
|
|
{sku: 'EPE', name: 'Extreme Probe Emulator', description: 'Protocol android', price: 953, instock: 1, categories: ['Robot']},
|
|
{sku: 'EMM', name: 'Exceptional Medical Machine', description: 'R2 maintenance robot and secret messenger. Help me Obi Wan', price: 1024, instock: 1, categories: ['Robot']},
|
|
{sku: 'SHCE', name: 'Strategic Human Control Emulator', description: 'Time travelling companion at heel', price: 300, instock: 12, categories: ['Robot']},
|
|
{sku: 'RED', name: 'Responsive Enforcer Droid', description: 'Red Drawf crew member', price: 700, instock: 5, categories: ['Robot']},
|
|
{sku: 'RMC', name: 'Robotic Mining Cyborg', description: 'Marvin, your paranoid android. Brain the size of a planet', price: 42, instock: 48, categories: ['Robot']},
|
|
{sku: 'STAN-1', name: 'Stan', description: 'APM guru', price: 67, instock: 1000, categories: ['Robot', 'Artificial Intelligence']},
|
|
{sku: 'CNA', name: 'Cybernated Neutralization Android', description: 'Could be R. Daneel Olivaw? Protype positronic brain android', price: 1000, instock: 0, categories: ['Robot']}
|
|
]);
|
|
|
|
// full text index for searching
|
|
db.products.createIndex({
|
|
name: "text",
|
|
description: "text"
|
|
});
|
|
|
|
// unique index for product sku
|
|
db.products.createIndex(
|
|
{ sku: 1 },
|
|
{ unique: true }
|
|
);
|
|
|