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
error when executing low.mixin #72
Comments
Hi @balasivagnanam, The API has changed, low._.mixin(_contrib); |
My bad sorry, here is the correct version: var low = require('lowdb')
var _contrib = require('underscore-contrib')
var db = low('db.json')
db._.mixin(_contrib) |
is this _ here is underscore definition or its with lowdb... |
doesn't work that way as well :(
|
Weird, there's a test for I'll take more time to test later. You're on |
yes 0.10.2 , even I saw the test when I tried to find the way to implement it. but not sure why it is not working... here is a gist https://gist.github.com/balasivagnanam/ec1f606f0cbdc0040608 |
Based on your screenshot, it seems like the error comes from line var page = dbinstance('results').insert(pagelevel).value(); // Error You can actually remove |
I am passing dbinstance and page to another module which is doing insert as a subset inside this..
you can check the same gist.. |
and the error is at getPath TypeError: undefined is not a function |
It's actually because you're chaining lodash and other methods without dbinstance('results')
.chain()
.getById(page.id) // I think you want to get by id here
.getPath('components')
.insert({component :'header',
condition : "Standard MOM Header should be present",
result : "Fail" ,
remarks: "Missing Standard Header"
})
.value() |
there is no error after doing chain(), but with get(page.id) there is no insert at inside level happening, when I change to getById I start to get undefined is not a function at this location. updated gist |
woww... it works :)
|
thanks a lot :) your help is highly appreciated :) |
You're welcome :) |
I saw your example to insert json with inner nodes of the other json. but I get this error when I execute the same code.
Not sure what is missing here.
Thanks,
The text was updated successfully, but these errors were encountered: