Last active
December 13, 2015 23:09
-
-
Save ellerrs/4989962 to your computer and use it in GitHub Desktop.
proposed product schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ProductSchema = new Schema({ | |
categoryId: String | |
, department: String | |
, ean: String | |
, model: String | |
, weight: String | |
, dimensions: { | |
height: String | |
, width: String | |
, length: String | |
} | |
, reviews: [{ | |
author: String | |
, title: String | |
, rating: String | |
, createdAt: Date | |
, updatedAt: Date | |
, text: String | |
, helpfulCount: Number | |
, comments: [{ | |
author: String | |
, createdAt: Date | |
, updatedAt: Date | |
, text: String | |
}] | |
}] | |
, category: String | |
, imagesCount: Number | |
, images: [{ type: String }] | |
, features: [] | |
, name: String | |
, description: String | |
, createdAt: { type: Date } | |
, updatedAt: { type: Date } | |
, price: String | |
, upc: String | |
, brand: String | |
, mpn: String | |
, manufacturer: String | |
, siteDetails: [{ | |
sku: String | |
, name: String | |
, salesRank: String | |
, url: String | |
}] | |
}) |
For the iPod example, those would be separate products (sku). This should hold true for items of different color as well, until we get to clothing. I added in the features object (but left it very wild-west for now).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How does reviews work into these? Is that a separate schema/call? What about coupons/offers? I also like how Semantics has a "features" object (a link to their schema: http://bluetide.pro/gVDk/5qEj1aBD). Can we have something like that? You may need to account for some form of "variation_id" so we can say "iPod", then have variations of like 1st gen, 2nd gen, etc. Or will those just be separate products? Can we get a "images_total" above images that is just a count of that object. Thoughts?