Closed FLamparski closed 9 years ago
Can you provide a script that insert non valid docs?
On Thu, Aug 27, 2015, 14:21 Filip Wieland notifications@github.com wrote:
I have an array of documents xs. Stuff.insert(xs, {error: 'replace'}) inserts xs into the table, but allows invalid documents to be inserted. They then cause errors on retrieval. I'm using the current npm version of thinky.
— Reply to this email directly or view it on GitHub https://github.com/neumino/thinky/issues/330.
Do you have asynchronous hooks?
On Thu, Aug 27, 2015, 14:28 Michel Tu orphee@gmail.com wrote:
Can you provide a script that insert non valid docs?
On Thu, Aug 27, 2015, 14:21 Filip Wieland notifications@github.com wrote:
I have an array of documents xs. Stuff.insert(xs, {error: 'replace'}) inserts xs into the table, but allows invalid documents to be inserted. They then cause errors on retrieval. I'm using the current npm version of thinky.
— Reply to this email directly or view it on GitHub https://github.com/neumino/thinky/issues/330.
No, I'm just defining a model schema. In particular, I'm defining a field in a nested object to be string().enum([...]), however the batch insert lets this field have a value not in the enum.
On Thu, 27 Aug 2015 at 22:30 Michel notifications@github.com wrote:
Do you have asynchronous hooks?
On Thu, Aug 27, 2015, 14:28 Michel Tu orphee@gmail.com wrote:
Can you provide a script that insert non valid docs?
On Thu, Aug 27, 2015, 14:21 Filip Wieland notifications@github.com wrote:
I have an array of documents xs. Stuff.insert(xs, {error: 'replace'}) inserts xs into the table, but allows invalid documents to be inserted. They then cause errors on retrieval. I'm using the current npm version of thinky.
— Reply to this email directly or view it on GitHub https://github.com/neumino/thinky/issues/330.
— Reply to this email directly or view it on GitHub https://github.com/neumino/thinky/issues/330#issuecomment-135560608.
insert
is the ReQL command and doesn't do validation. Use Model.save
or use doc.save
.
I have an array of documents
xs
.Stuff.insert(xs, {error: 'replace'})
inserts xs into the table, but allows invalid documents to be inserted. They then cause errors on retrieval. I'm using the current npm version of thinky.