Coder Social home page Coder Social logo

Inconsistent usage of this.database about doqmentdb HOT 3 CLOSED

a8m avatar a8m commented on August 29, 2024
Inconsistent usage of this.database

from doqmentdb.

Comments (3)

JanneSalo avatar JanneSalo commented on August 29, 2024

Hmm, could this maybe be fixed simply by adding a new property in the DoQmentDB object: this.dbName, initializing it in the constructor and then passing this.dbName to Collection constructor?

from doqmentdb.

a8m avatar a8m commented on August 29, 2024

Thanks @JanneSalo
Updated version v0.2.4, fix this bug and also added operations supporting, see: README
I'm just curious why you don't using collection simply like that ?

var db = new DoQmentDB(...)
  , users = db.use('users');

users.find({})
  .then(console.log)

from doqmentdb.

JanneSalo avatar JanneSalo commented on August 29, 2024

Thanks! I just tested this and the issue indeed seems to be fixed.

There's a reason I'm getting the collections in such a peculiar way. It all comes down to working around DocumentDB limitations, really. I work on a project where the 10GB cap on collection might become an issue, so we've had to split some data that logically belongs in one collection into several collections. I wrote a little wrapper function to query across all collections at once, but in order to do that, I first need to know which collections exist in the database as simply getting collection manager for each possible collection (there aren't that many, but still) isn't an option because doing a find() on a collection that doesn't exist causes the collection to be created and that's where we run into another limitation of DocumentDB: only 3 collections per CU are allowed. That's why I need to know what to query before I query. :)

from doqmentdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.