0

I'm tring my hand in Meteor - so far, I like it :-) However, I am trying to store a JSON object directly into miniMongo, but not getting anywhere - while I thought that was the purpose :-)

  testVar = {"test":"this is from the object"}

  QStore.update(
    {"_id" : QT._id},
    {
      $set: {
        "tCode" : testVar,
        "name" : "verion 6"
      }
    }
  )

in the schema of the QStore, tCode is defined as {object} which I thought would be right... where am I wrong? :-)

regards,

Paul

1
  • oh, maybe stating the obvious, but it does not work :-) JS says when I retrieve it, it is a object, but I cannot get any properties from it... :--( Commented May 7, 2015 at 16:22

1 Answer 1

3

Assuming you're using aldeed:simple-schema and everything else is okay (which is tough to tell with only the code snippet above), it's most likely you're missing the blackbox flag in your schema definition:

blackbox If you have a key with type Object, the properties of the object will be validated as well, so you must define all allowed properties in the schema. If this is not possible or you don't care to validate the object's properties, use the blackbox: true option to skip validation for everything within the object.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.