Taking an array such as ['hello', 'there'] and storing that in a Mongoose document with a schema such as
tags: { type: Array }
using something such as:
Something.create({ tags: ['hello', 'there']}, cb);
Then using ShouldJS to check that the document matches my supplied array I would expect this:
doc.tags.should.eql(['hello', 'there']);
But it does not. If I console.log doc tags I get:
[hello, there]
Notice that the quotes are gone. The doc.tags is indeed an array (I can check instanceof Array) and I can also use shouldjs with
doc.tags.should.have.keys('hello');
doc.tags.should.have.keys('there');
Anyone have an idea as to why my array doesn't match anymore?