Ryan
Ryan

Reputation: 1019

Inserting array into mongodb gives an error

So here's my mongodbSchema:

Schema = new SimpleSchema({

room: { type: [String] }

});

Room = new Mongo.Collection('room')
Room.attachSchema(Schema)

Now when I try to insert an array into it

Room.insert(["hello", "dog"]);

it gives me this error, "RangeError: Maximum call stack size exceeded"

Upvotes: 0

Views: 63

Answers (1)

Ryan
Ryan

Reputation: 1019

woops, rookie mistake. Room.insert({room: ["hello", "dog"]});

Upvotes: 1

Related Questions