Note that there are some explanatory texts on larger screens.

plurals
  1. POMeteor - MongoDB Error: Cannot apply $addToSet modifier to non-array
    primarykey
    data
    text
    <p>I am following the recently published book "<a href="http://amzn.com/1782160825" rel="nofollow noreferrer">Getting Started with Meteor.js JavaScript Framework</a>" by Isaac Strack. The book works with Meteor 0.5.0. I am working with version 0.5.4.</p> <p>In the book you build an app with a few categories to which you insert data for tracking household items, and who they may be lent to. I deployed the app to a <a href="http://lendlib.meteor.com/" rel="nofollow noreferrer">meteor subdomain</a>, and it is working perfectly. It does not replicate my local MongoDB error.</p> <p><img src="https://i.stack.imgur.com/b1KcK.png" alt="LendLib"></p> <p>I am in Chapter 5, and I have just removed autopublish from the app, and specified my local channels for data.</p> <p>Locally, under the under the "Tools" category only, when I try to add a new item to the category, I recieve this error in my browser console:</p> <pre><code>Exception while simulating the effect of invoking '/Lists/update' Error {} Error: Cannot apply $addToSet modifier to non-array at Error (&lt;anonymous&gt;) at LocalCollection._modifiers.$addToSet (http://localhost:3000/packages/minimongo/modify.js?e7f02f0df0bff9f0b97236f9548637b7ede1ac74:178:13) at Function.LocalCollection._modify (http://localhost:3000/packages/minimongo/modify.js?e7f02f0df0bff9f0b97236f9548637b7ede1ac74:53:9) at LocalCollection._modifyAndNotify (http://localhost:3000/packages/minimongo/minimongo.js?7f5131f0f3d86c8269a6e6db0e2467e28eff6422:474:19) at LocalCollection.update (http://localhost:3000/packages/minimongo/minimongo.js?7f5131f0f3d86c8269a6e6db0e2467e28eff6422:444:12) at m.(anonymous function) (http://localhost:3000/packages/mongo-livedata/collection.js?3ef9efcb8726ddf54f58384b2d8f226aaec8fd53:415:36) at http://localhost:3000/packages/livedata/livedata_connection.js?367884963b120d457819216ff713b2586b266dde:540:25 at _.extend.withValue (http://localhost:3000/packages/meteor/dynamics_browser.js?46b8d1f1158040fcc2beb7906ec2f932871a398d:21:19) at _.extend.apply (http://localhost:3000/packages/livedata/livedata_connection.js?367884963b120d457819216ff713b2586b266dde:539:47) at Meteor.Collection.(anonymous function) [as update] (http://localhost:3000/packages/mongo-livedata/collection.js?3ef9efcb8726ddf54f58384b2d8f226aaec8fd53:266:23) logging.js:30 update failed: Internal server error logging.js:30 </code></pre> <p>The tools category already has one item in it which was submitted earlier in the tutorial. If I type into the console <code>lists.findOne({Category:"Tools"});</code> I get the output which recognizes an item in the Object:</p> <pre><code>Object Category: "Tools" _id: "eaa681e1-83f2-49f2-a42b-c6d84e526270" items: Object LentTo: "Steve" Name: "Linear Compression Wrench" Owner: "me" __proto__: Object __proto__: Object </code></pre> <p>However, the screen output is blank:</p> <p><img src="https://i.stack.imgur.com/SMDGd.png" alt="enter image description here"></p> <p>Naturally I have tried restarting the meteor server &amp; shut down the browser, but no resolution. I am new to MongoDB, so I am unclear as to where to turn to understand what is causing this problem, or why.</p> <p>You can <a href="http://lendlib.meteor.com/" rel="nofollow noreferrer">view the app here</a>. You can view the code on my <a href="https://github.com/stat30fbliss/LendLib" rel="nofollow noreferrer">GitHub</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload