2018-04-20T19:59:07.849+00:00 [INFO] "Inside OnUpdate:" {"category":"drinks","complete":false,"createdAt":12006,"description":"amber nectar","image":"beer.png","name":"beer","price":2.35,"product":"beer","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} "Inside OnUpdate:" {"name":"admin","all_channels":{"!":1},"sequence":2} 2018-04-20T19:59:07.849+00:00 [INFO] 2018-04-20T19:59:07.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.849+00:00 [INFO] "Inside OnUpdate:" {"category":"snacks","complete":false,"createdAt":12007,"description":"chocloate chip","image":"cookie.png","name":"cookie","price":1.42,"product":"cookie","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:07.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.850+00:00 [INFO] "Inside OnUpdate:" {"name":"moderator","all_channels":null,"sequence":1} 2018-04-20T19:59:07.850+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[209399995490701,0]]} 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate:" {"Sync":"\nfunction(doc, oldDoc){\n /* Type validation */\n if (isCreate()) {\n // Don't allow creating a document without a type.\n validateNotEmpty(\"type\", doc.type);\n } else if (isUpdate()) {\n // Don't allow changing the type of any document.\n validateReadOnly(\"type\", doc.type, oldDoc.type);\n }\n\n if (getType() == \"moderator\") {\n /* Control Write Access */\n // Only allow admins to add/remove moderators.\n requireRole(\"admin\");\n\n /* Validate */\n if (!isDelete()) {\n // Validate required fields.\n validateNotEmpty(\"username\", doc.username);\n\n if (isCreate()) {\n // We use a key pattern to ensure unique moderators within the system, \n // so we need to ensure that doc._id matches the pattern\n // moderator.{username}.\n if (doc._id != \"moderator.\" + doc.username) {\n throw({forbidden: \"_id must match the pattern moderator.{username}.\"});\n }\n } else {\n // doc._id is tied to username, validated during create, and must remain this\n // way to ensure unique moderators within the system.\n validateReadOnly(\"username\", doc.username, oldDoc.username);\n }\n }\n\n /* Route */\n if (!isDelete()) {\n // Add user to moderator role.\n role(doc.username, \"role:moderator\");\n } \n // Add doc to the user's channel.\n var username = doc._deleted ? oldDoc.username : doc.username;\n channel(username);\n\n /* Grant Read Access */\n if (!isDelete()) {\n // Grant user access to moderators channel.\n access(doc.username, \"moderators\");\n }\n // Grant user access to their channel.\n access(doc.username, doc.username);\n } else if (getType() == \"product-list\") { // Product List access control\n /* Write Access */\n var owner = doc._deleted ? oldDoc.owner : doc.owner;\n try {\n // Moderators can create/update lists for other users.\n requireRole(\"moderator\");\n } catch (e) {\n // Users can create/update lists for themselves.\n requireUser(owner);\n }\n\n /* Validation */\n if (!isDelete()) {\n // Validate required fields.\n validateNotEmpty(\"name\", doc.name);\n validateNotEmpty(\"owner\", doc.owner);\n\n if (isCreate()) {\n\t// DH\n // Validate that the _id is prefixed by owner.\n if (0 && !hasPrefix(doc._id, doc.owner + \".\")) {\n throw({forbidden: \"product-list id must be prefixed by list owner\"});\n }\n } else {\n // Don’t allow product-list ownership to be changed.\n validateReadOnly(\"owner\", doc.owner, oldDoc.owner);\n }\n }\n\n /* Routing */\n // Add doc to product-list's channel.\n channel(\"product-list.\" + doc._id);\n channel(\"moderators\");\n\n /* Read Access */\n // Grant product-list owner access to the product-list, its products, and its users.\n access(owner, \"product-list.\" + doc._id);\n access(owner, \"product-list.\" + doc._id + \".users\");\n access(\"role:moderator\", \"product-list.\" + doc._id);\n } else if (getType() == \"product\") {\n /* Write Access */\n if (!isDelete()) {\n validateNotEmpty(\"productList\", doc.productList);\n }\n var owner = doc._deleted ? oldDoc.productList.owner : doc.productList.owner;\n var listId = doc._deleted ? oldDoc.productList.id : doc.productList.id;\n try {\n requireAccess(\"product-list.\" + listId);\n } catch (e) {\n requireUser(owner);\n }\n\n /* Validate */\n if (!isDelete()) {\n // Validate required fields.\n validateNotEmpty(\"productList.id\", doc.productList.id);\n validateNotEmpty(\"productList.owner\", doc.productList.owner);\n validateNotEmpty(\"product\", doc.product);\n\n if (isCreate()) {\n // Validate that the productList.id is prefixed by productList.owner. We only need to\n // validate this during create because these fields are read-only after create.\n\t// DH\n if (0 && !hasPrefix(doc.produ 2018-04-20T19:59:07.860+00:00 [INFO] ctList.id, doc.productList.owner + \".\")) {\n throw({forbidden: \"product-list id must be prefixed by product-list owner\"});\n }\n } else {\n // Don’t allow products to be moved to another product-list.\n validateReadOnly(\"productList.id\", doc.productList.id, oldDoc.productList.id);\n validateReadOnly(\"productList.owner\", doc.productList.owner, oldDoc.productList.owner);\n }\n }\n\n /* Route */\n // Add doc to product-list and moderators channel.\n channel(\"product-list.\" + listId);\n channel(\"moderators\");\n } else if (getType() == \"product-list.user\") {\n /* Control Write Access */\n if (!isDelete()) {\n validateNotEmpty(\"productList\", doc.productList);\n }\n var owner = doc._deleted ? oldDoc.productList.owner : doc.productList.owner;\n var username = doc._deleted ? oldDoc.username : doc.username;\n try {\n requireUser(owner);\n } catch (e) {\n requireRole(\"moderator\");\n }\n\n /* Validate */\n if (!isDelete()) {\n // Validate required fields.\n validateNotEmpty(\"productList.id\", doc.productList.id);\n validateNotEmpty(\"productList.owner\", doc.productList.owner);\n validateNotEmpty(\"username\", doc.username);\n\n if (isCreate()) {\n // We use a key pattern to ensure unique users w/in a list, so we need to\n // ensure that doc._id matches the pattern {productList.id}.{username}.\n if (doc._id != doc.productList.id + \".\" + doc.username) {\n throw({forbidden: \"_id must match the pattern {productList.id}.{username}.\"});\n }\n\n // Validate that the productList.id is prefixed by productList.owner.\n if (!hasPrefix(doc.productList.id, doc.productList.owner + \".\")) {\n throw({forbidden: \"product-list id must be prefixed by product-list owner\"});\n }\n } else {\n // Don’t allow users to be moved to another product-list. Also, doc._id is tied to\n // these values, validated during create, and must remain this way to ensure\n // uniqueness within a list.\n validateReadOnly(\"productList.id\", doc.productList.id, oldDoc.productList.id);\n validateReadOnly(\"productList.owner\", doc.productList.owner, oldDoc.productList.owner);\n }\n }\n\n /* Route */\n // Add doc to product-list users and moderators channel.\n var listId = doc._deleted ? oldDoc.productList.id : doc.productList.id;\n channel(\"product-list.\" + listId + \".users\");\n channel(\"moderators\");\n\n /* Grant Read Access */\n // Grant the user access to the product-list and its products.\n if (!isDelete()) {\n access(doc.username, \"product-list.\" + listId);\n }\n\n channel(username);\n } else if (getType() == \"order\")\n {\nlog(\"Found a basket\");\n}\n\nelse {\n // Log invalid document type error.\n log(\"Invalid document type: \" + doc.type);\n\n throw({forbidden: \"Invalid document type: \" + doc.type});\n }\n\n function getType() {\n return (isDelete() ? oldDoc.type : doc.type);\n }\n\n function isCreate() {\n // Checking false for the Admin UI to work\n return ((oldDoc == false) || (oldDoc == null || oldDoc._deleted) && !isDelete());\n }\n\n function isUpdate() {\n return (!isCreate() && !isDelete());\n }\n\n function isDelete() {\n return (doc._deleted == true);\n }\n\n function validateNotEmpty(key, value) {\n if (!value) {\n throw({forbidden: key + \" is not provided.\"});\n }\n }\n\n function validateReadOnly(name, value, oldValue) {\n if (value != oldValue) {\n throw({forbidden: name + \" is read-only.\"});\n }\n }\n\n // Checks whether the provided value starts with the specified prefix\n function hasPrefix(value, prefix) {\n if (value && prefix) {\n return value.substring(0, prefix.length) == prefix\n } else {\n return false\n }\n }\n}\n "} 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[87602465390813,0]]} 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate:" {"category":"drinks","complete":false,"createdAt":12005,"description":"Vin Rouge","image":"red_wine.png","name":"red wine","price":3.43,"product":"red wine","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"category":"snacks","complete":false,"createdAt":12008,"description":"milk, dark or white","image":"chocolate.png","name":"chocolate","price":1.03,"product":"chocolate","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12021,"description":"Beans, beans the musical fruit, the more you eat...","image":"beans.png","name":"baked beans","price":0.98,"product":"baked beans","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"name":"david","admin_channels":{"david":3},"all_channels":null,"sequence":3,"passwordhash_bcrypt":"JDJhJDEwJFN4eDNGb0ZxR1JiYXh4QlFiVi9USy5nR0xtekVVSDdhS0JoR1NXT3hJYy5nNVovWE5ESTg2","rolesSince":{}} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[94427157663136,0]]} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[257542030306596,0]]} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"category":"fruit","complete":false,"createdAt":12018,"description":"Granny smiths and golden delicious","image":"apples.png","name":"apples","price":4.6,"product":"apples","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"name":"big fat shopping list","owner":"david","type":"product-list"} 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:07.872+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[137942658828875,0]]} 2018-04-20T19:59:07.873+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.848+00:00 [INFO] "Inside OnUpdate:" {"category":"fruit","complete":false,"createdAt":12015,"description":"You'll go crazy for these bananas","image":"bananas.png","name":"bananas","price":1.91,"product":"bananas","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:12.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[169358521818182,0]]} 2018-04-20T19:59:12.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[213948026830413,0]]} 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate:" {"name":"admin","all_channels":{"!":1},"sequence":5,"passwordhash_bcrypt":"JDJhJDEwJGdTNWxLWFZJd0plejhqdGVUdnBLa3UxQTBLZVBvZWJrdWxMMGszaXczMG1JOEJJMG9sbDUy","explicit_roles":{"admin":5},"rolesSince":null} 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate:" {"category":"basics","complete":false,"createdAt":12012,"description":"The best thing since sliced...","image":"bread.png","name":"bread","price":3.14,"product":"bread","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:12.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.871+00:00 [INFO] "Inside OnUpdate:" {"category":"basics","complete":false,"createdAt":12011,"description":"Don't put all these in one basket","image":"eggs.png","name":"eggs","price":3,"product":"eggs","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:12.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:12.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[108173960118310,0]]} 2018-04-20T19:59:12.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.848+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[240973514346761,0]]} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[116889259460803,0]]} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[82358157912309,0]]} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"category":"meat","complete":false,"createdAt":12000,"description":"Mmmm. That IS a tasty burger","image":"burger.png","name":"burger","price":4.36,"product":"burger","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12017,"description":"Go well with cream at Wimbledon","image":"tea_bags.png","name":"tea bags","price":4.98,"product":"tea bags","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"category":"fruit","complete":false,"createdAt":12016,"description":"Totally tropical taste","image":"pineapple.png","name":"pineapple","price":0.31,"product":"pineapple","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[131077785419695,0]]} 2018-04-20T19:59:17.849+00:00 [INFO] 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"items":["product:burger","product:ham","product:sausages","product:water","product:champagne","product:red wine","product:beer","product:cookie","product:chocolate","product:crisps","product:cheese","product:eggs","product:bread","product:butter","product:milk","product:bananas","product:pineapple","product:tea bags","product:apples","product:fish fingers","product:pot noodle","product:baked beans","product:scotch egg","product:marmite"]} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[191018452736819,0]]} 2018-04-20T19:59:17.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.850+00:00 [INFO] "Inside OnUpdate:" {"name":"mod","all_channels":{"!":1},"sequence":4,"passwordhash_bcrypt":"JDJhJDEwJEE4RkZIV0FhczNOYWVqM2RFTHpsNHVvMHpZVmczLkpKVGlJY21tbEZoMjNtZTV0MHRlSkJx","explicit_roles":{"moderator":4},"rolesSince":null} 2018-04-20T19:59:17.850+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.850+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[70163224171414,0]]} 2018-04-20T19:59:17.850+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[67511042350261,0]]} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":4,"snapEnd":4,"failOverLog":[[99715628616358,0]]} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"category":"meat","complete":false,"createdAt":12002,"description":"A string of bangers","image":"sausages.png","name":"sausages","price":0.54,"product":"sausages","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"category":"drinks","complete":false,"createdAt":12003,"description":"h20","image":"water.png","name":"water","price":3.65,"product":"water","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[175219863508516,0]]} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"category":"drinks","complete":false,"createdAt":12004,"description":"Lovely bubbly","image":"champagne.png","name":"champagne","price":3.08,"product":"champagne","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[59283132069515,0]]} 2018-04-20T19:59:17.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[230285665785442,0]]} 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[164438337473252,0]]} 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":4,"snapEnd":4,"failOverLog":[[249512931533732,0]]} 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12019,"description":"Only the best at the captain's table","image":"fish_fingers.png","name":"fish fingers","price":4.35,"product":"fish fingers","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[104636694846236,0]]} 2018-04-20T19:59:17.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:17.872+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[142711180431621,0]]} 2018-04-20T19:59:17.872+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.848+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12022,"description":"Perfect for picnics - a boiled egg, shrouded in meat and breadcrumbs","image":"scotch_egg.png","name":"scotch egg","price":1.66,"product":"scotch egg","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[101238660015443,0]]} 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate:" {"category":"basics","complete":false,"createdAt":12014,"description":"No sense crying over this","image":"milk.png","name":"milk","price":2.5,"product":"milk","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[225275684562673,0]]} 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[73102590051486,0]]} 2018-04-20T19:59:22.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"category":"snacks","complete":false,"createdAt":12009,"description":"A flavour for everyone","image":"crisps.png","name":"crisps","price":0.32,"product":"crisps","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12023,"description":"Love it or hate it, it goes well on toast","image":"marmite.png","name":"marmite","price":2.19,"product":"marmite","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":37,"snapEnd":37,"failOverLog":[[34891093262726,0]]} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[185255091622607,0]]} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"category":"snacks","complete":false,"createdAt":12010,"description":"Smelly pong","image":"cheese.png","name":"cheese","price":3.05,"product":"cheese","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[74178841905922,0]]} 2018-04-20T19:59:22.860+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate:" {"category":"basics","complete":false,"createdAt":12013,"description":"Put on a good spread","image":"butter.png","name":"butter","price":0.51,"product":"butter","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate:" {"category":"british","complete":false,"createdAt":12020,"description":"The finest of snacks - all you need is a kettle and a student","image":"pot_noodle.png","name":"pot noodle","price":0.92,"product":"pot noodle","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[254685238883942,0]]} 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate:" {"category":"meat","complete":false,"createdAt":12001,"description":"Du jambon","image":"ham.png","name":"ham","price":0.5,"product":"ham","productList":{"id":"david.all_the_products","owner":"david"},"stock":100,"type":"product"} 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[130321376404129,0]]} 2018-04-20T19:59:22.871+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:24.012+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[103791377475020,0]]} 2018-04-20T19:59:24.012+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:24.012+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":3,"snapEnd":3,"failOverLog":[[102745391193889,0]]} 2018-04-20T19:59:24.012+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T19:59:24.067+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[191686007144186,0]]} 2018-04-20T19:59:24.067+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:03:12.859+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":38,"snapEnd":38,"failOverLog":[[34891093262726,0]]} 2018-04-20T20:03:12.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:27.849+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[121569889893950,0]]} 2018-04-20T20:18:27.849+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:27.859+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":39,"snapEnd":39,"failOverLog":[[34891093262726,0]]} 2018-04-20T20:18:27.859+00:00 [INFO] "Inside OnUpdate:" {"type":"order","name":"karthik","ts":1524255503,"order":["product:apples","product:champagne","product:red wine","product:fish fingers","product:scotch egg"]} 2018-04-20T20:18:27.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:27.874+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:27.874+00:00 [INFO] "Inside OnUpdate:" {"name":"karthik","order":["product:apples","product:champagne","product:red wine","product:fish fingers","product:scotch egg"],"ts":1524255503,"type":"order"} 2018-04-20T20:18:27.877+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:42.859+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":2,"snapEnd":2,"failOverLog":[[19704639491526,0]]} 2018-04-20T20:18:42.859+00:00 [INFO] "Inside OnUpdate:" {"seqStart":0,"seqEnd":0,"snapStart":40,"snapEnd":40,"failOverLog":[[34891093262726,0]]} 2018-04-20T20:18:42.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:42.859+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 1 2018-04-20T20:18:42.871+00:00 [INFO] "Inside OnUpdate:" {"type":"order","name":"karthik","ts":1524255518,"order":["product:apples","product:champagne","product:red wine","product:fish fingers","product:scotch egg"]} 2018-04-20T20:18:42.883+00:00 [INFO] "Inside For-OfLoop - value of count: " 2 2018-04-20T20:18:42.885+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 2 2018-04-20T20:18:42.885+00:00 [INFO] "Inside OnUpdate:" {"name":"karthik","order":["product:apples","product:champagne","product:red wine","product:fish fingers","product:scotch egg"],"ts":1524255518,"type":"order"} 2018-04-20T20:18:42.888+00:00 [INFO] "Inside For-OfLoop - value of count: " 3 2018-04-20T20:18:42.889+00:00 [INFO] "Inside OnUpdate - value of count before exiting: " 3