Skip to content
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

Uncaught TypeError: this.db.approximateSize is not a function #182

Open
pjain01 opened this issue Feb 14, 2019 · 0 comments
Open

Uncaught TypeError: this.db.approximateSize is not a function #182

pjain01 opened this issue Feb 14, 2019 · 0 comments

Comments

@pjain01
Copy link

pjain01 commented Feb 14, 2019

@mcollina

Getting this exception:
Uncaught TypeError: this.db.approximateSize is not a function
at DB.approximateSize (index.js:83)
at deferred-leveldown.js:23
at Array.forEach ()
at deferred-leveldown.js:22
at abstract-leveldown.js:33
at abstract-leveldown.js:33
at IDBOpenDBRequest.req.onsuccess (index.js:46)

var level = require('level');
var levelgraph = require("levelgraph");
var db = levelgraph( level('newDB' ) ) ;

db.put( [{
subject: "matteo",
predicate: "friend",
object: "daniele"
}, {
subject: "daniele",
predicate: "friend",
object: "matteo"
},
works fine but when I try to use
db.nav("matteo").archIn("friend").archOut("friend").
solutions(function(err, results) {
console.log(results);
});

I get this exception.

I am using latest level and level-graph.
"dependencies": {
..................
"level": "^5.0.0-0",
"level-js": "^4.0.0",
"levelgraph": "^2.1.1",
.....
}

For now I could get it working(I can see correct output) by commenting out code in "node_modules\encoding-down\index.js":
// DB.prototype.approximateSize = function (start, end, opts, cb) {
// start = this.codec.encodeKey(start, opts)
// end = this.codec.encodeKey(end, opts)
// return this.db.approximateSize(start, end, opts, cb)
// }

but I am not fully sure whether this is a right way to do ??

As per my understanding from various of posts , "db.approximateSize" has been moved to leveldown and so is not part of level-js and hence commenting it out is correct.

Can you please suggest the correct wayout ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant