Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
id,_version_,BRAND_s,NAME_s,type_s,COLOR_s,SIZE_s,STATE_s,PRICE_i,QTY_i
13,,,,storage,,,CA,,10
14,,,,storage,,,NY,,0
11,,,,sku,Red,XL,,,
15,,,,storage,,,CA,,0
16,,,,storage,,,NY,,100
12,,,,sku,Blue,XL,,,
17,,,Bob,vendor,,,,20,
18,,,Alice,vendor,,,,22,
10,1453160899682500608,Nike,,product,,,,,
23,,,,storage,,,CA,,10
24,,,,storage,,,NY,,5
21,,,,sku,Red,M,,,
25,,,,storage,,,CA,,10
26,,,,storage,,,NY,,0
22,,,,sku,Blue,XL,,,
27,,,Bob,vendor,,,,20,
28,,,Alice,vendor,,,,25,
20,1453160899706617856,Nike,,product,,,,,
34,,,,storage,,,CA,,0
35,,,,storage,,,NY,,10
31,,,,sku,Red,M,,,
36,,,,storage,,,CA,,200
37,,,,storage,,,NY,,0
32,,,,sku,Blue,XL,,,
38,,,Alice,vendor,,,,20,
39,,,Bob,vendor,,,,30,
30,1453160899711860736,Puma,,product,,,,,
<!--
@startuml
class Product {
BRAND_s
}
class SKU {
COLOR_s
SIZE_s
}
class Storage {
STATE_s
QTY_i
}
class Vendor {
NAME_s
PRICE_i
}
Product *-> "*" SKU
SKU *-> "*" Storage
Product *-down-> "*" Vendor
@enduml
-->
<update>
<delete><query>*:*</query></delete>
<add>
<doc>
<field name="id">10</field> <field name="type_s">product</field>
<field name="BRAND_s">Nike</field>
<!-- nesting skus in product -->
<doc>
<field name="id">11</field> <field name="type_s">sku</field>
<field name="COLOR_s">Red</field> <field name="SIZE_s">XL</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">13</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">10</field>
</doc>
<doc>
<field name="id">14</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">0</field>
</doc>
</doc>
<doc>
<field name="id">12</field> <field name="type_s">sku</field>
<field name="COLOR_s">Blue</field> <field name="SIZE_s">XL</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">15</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">0</field>
</doc>
<doc>
<field name="id">16</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">100</field>
</doc>
</doc>
<!-- nesting vendors into product -->
<doc>
<field name="id">17</field> <field name="type_s">vendor</field>
<field name="NAME_s">Bob</field> <field name="PRICE_i">20</field>
</doc>
<doc>
<field name="id">18</field> <field name="type_s">vendor</field>
<field name="NAME_s">Alice</field> <field name="PRICE_i">22</field>
</doc>
</doc>
<doc>
<field name="id">20</field> <field name="type_s">product</field>
<field name="BRAND_s">Nike</field>
<doc>
<field name="id">21</field> <field name="type_s">sku</field>
<field name="COLOR_s">Red</field> <field name="SIZE_s">M</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">23</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">10</field>
</doc>
<doc>
<field name="id">24</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">5</field>
</doc>
</doc>
<doc>
<field name="id">22</field> <field name="type_s">sku</field>
<field name="COLOR_s">Blue</field> <field name="SIZE_s">XL</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">25</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">10</field>
</doc>
<doc>
<field name="id">26</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">0</field>
</doc>
</doc>
<!-- nesting vendors into product -->
<doc>
<field name="id">27</field> <field name="type_s">vendor</field>
<field name="NAME_s">Bob</field> <field name="PRICE_i">20</field>
</doc>
<doc>
<field name="id">28</field> <field name="type_s">vendor</field>
<field name="NAME_s">Alice</field> <field name="PRICE_i">25</field>
</doc>
</doc>
<doc>
<field name="id">30</field> <field name="type_s">product</field>
<field name="BRAND_s">Puma</field>
<doc>
<field name="id">31</field> <field name="type_s">sku</field>
<field name="COLOR_s">Red</field> <field name="SIZE_s">M</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">34</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">0</field>
</doc>
<doc>
<field name="id">35</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">10</field>
</doc>
</doc>
<doc>
<field name="id">32</field> <field name="type_s">sku</field>
<field name="COLOR_s">Blue</field> <field name="SIZE_s">XL</field>
<!-- nesting locations into sku -->
<doc>
<field name="id">36</field> <field name="type_s">storage</field>
<field name="STATE_s">CA</field> <field name="QTY_i">200</field>
</doc>
<doc>
<field name="id">37</field> <field name="type_s">storage</field>
<field name="STATE_s">NY</field> <field name="QTY_i">0</field>
</doc>
</doc>
<!-- nesting vendors into product -->
<doc>
<field name="id">38</field> <field name="type_s">vendor</field>
<field name="NAME_s">Alice</field> <field name="PRICE_i">20</field>
</doc>
<doc>
<field name="id">39</field> <field name="type_s">vendor</field>
<field name="NAME_s">Bob</field> <field name="PRICE_i">30</field>
</doc>
</doc>
</add>
<commit/>
</update>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.