-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using type.any() results in errors. #261
Comments
@codedmart -- I just tried your snippet, and it works fine for me. If you still get an error, can you provide the stacktrace? Thanks |
Hmm.... I am still getting the error. I forgot to add
I use thinky this way: // thinky.js
var config = require('./config').config;
var thinky = require('thinky')(config.server.rethinkdb);
module.exports = thinky; // model.js
var Thinky = require('./thinky');
var type = Thinky.type;
var Model = Thinky.createModel('orders', {
id: String,
charge: type.any(),
}, {enforce_extra: 'remove'});
data = {test: "test", data: "data"};
new Model(data).save()
.then... |
Hum, I'm a bit confused, I can't reproduce your error. I tried this snippet and a few variants (changing the field name)
The error seems to be that a field in the schema does not have the property |
I am sorry @neumino. I have not written out what I am trying to do very well. // thinky.js
var config = require('./config').config;
var thinky = require('thinky')(config.server.rethinkdb);
module.exports = thinky; // model.js
var Thinky = require('./thinky');
var type = Thinky.type;
var Model = Thinky.createModel('orders', {
id: String,
charge: type.any(),
}, {enforce_extra: 'remove'});
data = {charge: {test: "test", data: "data"}};
new Model(data).save()
.then... Really what I want to do is use |
@codedmart -- it should be fix in 2.0.6. Let me know if you run into other issues ;) |
No matter how I try and use type.any() I get errors. Say I have something such as:
I get an error of
cannot read property test of undefined
or if I remove test from the object then I getcannot read property data of undefined
.Thanks
The text was updated successfully, but these errors were encountered: