Is this document built is best practice?

32 views
Skip to first unread message

dredme

unread,
May 22, 2012, 5:21:41 AM5/22/12
to ravendb
Do you think this is a good way to build my product document, this
sample comtains only one document named Product, no documents for
Review, Pictures, Videos, what is you opinion?

Product Document:

{
"Name": "Computer",
"Hardware": [
{
"Name": "Screen",
"Name": "HD"
}
],
"Reviews": [
{
"Body": "Great Computer, I like it very much",
"Ratings": [
{
"Name": "Ease of use",
"Value": 1.0,
"LastModified": "0001-01-01T00:00:00.0000000"
},
{
"Name": "Nice Looking",
"Value": 1.0,
"LastModified": "0001-01-01T00:00:00.0000000"
}
],
"OverallRating": 1.0,
"Username": "dorraba",
"LastModified": "0001-01-01T00:00:00.0000000"
},
{
"Body": "I liked this computer very mich, very recommended",
"Ratings": [
{
"Name": "Ease of use",
"Value": 0.2,
"LastModified": "0001-01-01T00:00:00.0000000"
},
{
"Name": "Quality of Hardware",
"Value": 0.6,
"LastModified": "0001-01-01T00:00:00.0000000"
}
],
"OverallRating": 0.8,
"Username": "moshe",
"LastModified": "0001-01-01T00:00:00.0000000"
}
],
"Pictures": [
{
"Title": "The Computer Package",
"Name": "Computer Package",
"Url": "http://www.google.com/pic1.jpg",
"Description": null,
"ProductId": 0,
"Username": moshe,
"LastModified": "0001-01-01T00:00:00.0000000"
}
],
"Videos": [
{
"Name": "This is my computerl",
"Url": "http://www.google.com/video1.mpg",
"Description": null,
"ProductId": 0,
"Username": dorraba,
"LastModified": "0001-01-01T00:00:00.0000000"
}
],
"LastModified": "2012-05-22T12:15:14.3868150"
}

Oren Eini (Ayende Rahien)

unread,
May 22, 2012, 5:39:03 AM5/22/12
to rav...@googlegroups.com
We can't answer the question without knowing what is the usage scenario for this is

dredme

unread,
May 22, 2012, 6:11:38 AM5/22/12
to ravendb
OK, sorry,

The application will be a reviews website where a user can write
reviews on a product he bought and rate each one of the product
features.
He could also upload photos and videos of his product.

Of course the most important thing is that I could show the 5 most
rated products, 5 worst products and so on...

Is this enough for knowing what is the best way to build it?



On May 22, 12:39 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Oren Eini (Ayende Rahien)

unread,
May 22, 2012, 7:00:00 AM5/22/12
to rav...@googlegroups.com
How many reviews for a product?

dredme

unread,
May 22, 2012, 7:46:51 AM5/22/12
to ravendb
A product can have up to 2000 reviews lets say

On May 22, 2:00 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Oren Eini (Ayende Rahien)

unread,
May 22, 2012, 7:49:34 AM5/22/12
to rav...@googlegroups.com
Split this into multiple documents.
See discussion here:
Reply all
Reply to author
Forward
0 new messages