Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    pubkey
    @pubkey
    @wtoalabi_twitter pouchdb does not remove deleted documents but instead marks them as deleted. This is so that the replication can work. When you said that deleted documents appeared again, do you mean that they got returned with RxDB queries or do you mean they appear when you inspect the content on indexeddb?
    Wale Alabi
    @wtoalabi_twitter
    Makes sense that since they are not deleted, they show up in indexdb...
    However, they reaapear in queries when I close the app, either forcefully or suddenly.
    One theory I am working with is, I didnt mark the id of each record as primary. I didnt do this at first because the schema complains that the id must be a string. I came from a more traditional mysql backgroud where ids are always integers. So I omitted. I just remembered now. Do you think this could have been the course?
    pubkey
    @pubkey
    Maybe, I have no information about how you insert data
    But now I think the problem is on your side. If you can reproduce this in a minimal code example, that would be good
    Wale Alabi
    @wtoalabi_twitter
    Let me create a quick gist. Thanks!
    @pubkey Thanks!!!
    verliba
    @verliba
    Hi, is it possible to update documents in the rxdb? I have results of find, and when I call save it complains about temporary document.. so how do I make it non-temporary ?
    in the same error it confuses me to read : _isTemporary: false,
    pubkey
    @pubkey
    use atomicUpdate and atomicSet and update()
    .save() only works for new, temporary documents
    verliba
    @verliba
    @pubkey thanks (the error message is confusing though), I am trying that..
    verliba
    @verliba
    @pubkey worked, thanks a lot
    Bastien
    @Ngb_01_gitlab

    Hi, I can't sort the items in a collection, I tried several methods without success. Maybe someone can help me. I use RxDB with Electron and websql adapter.

    First I tried the method proposed in the RxDB documentation.
    That's my request.

    playersCollection.find()
            .sort('lastName')
            .exec()
            .then(function (players) {
                console.log(players);
            });
    ̀

    For this request, I have this error message :
    WebSQL threw an error Error: SQLITE_ERROR: too many SQL variables

    I also tried the method proposed by pouch db.

    playersCollection.find({
                selector: {
                    'lastName': {$gte: null}
                },
                sort: ['lastName']
            })
            .exec()
            .then(function (players) {
                console.log(players);
            });

    In this case, I have this error:
    Uncaught (in promise) Error: unknown operator "lastName" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, $nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all

    In this two case, if I remove sort condition, the collection is returned fine. Of course, the "lastName" property is defined in my collection schema like :
    "properties": { "lastName": { "type": "string" }, ... }

    Thanks for your help.

    pubkey
    @pubkey
    @Ngb_01_gitlab please check if this problem also occurs with the internal pouchdb instance playersCollection.pouch.find(...)
    Bastien
    @Ngb_01_gitlab

    @pubkey thanks for your answer. Indeed, I probably made a mistake in my second example because this request works fine.

    playersCollection.pouch.find({
                selector: {
                    'lastName': {$gte: null}
                },
                sort: ['lastName']
            })
            .then(function (players) {
                console.log(players);
            });

    However, I don't understand why my first request didn't work. Did I forget something?

    Bastien
    @Ngb_01_gitlab
    @pubkey Sorry, I wasted your time. After having emptied my database, done your test, and retryed my first request, it works correctly now. I don't know what's changed.
    I can't explain it. I'll get back to you if the problem recurs or if I find the cause.
    Thank you very much anyway.
    pwcsolutions
    @pwcsolutions
    just wondering if there is some special magic rxdb does with regards to the primary fields?
    I have a schema that has _id: { type: "string", primary: true }. I generate the uuid via uuidv4(req.email) using the uuid npm package.
    the object gets stored, but the _id value is different if the same data is used on multiple requests
    just thought that perhaps rxdb might detect that the _id has been used before, and then generates a unique one instead? thought it throw an error though
    pwcsolutions
    @pwcsolutions
    forget that, seems UUIDv4 doesn't seem to generate an ID if you pass it a string, it only generates new ones.
    gautambt
    @gautambt

    @pubkey

    @gautambt Not with RxDB but you can query whatever you want by accessing the internal pouchdb

    Thanks for getting back to me. In this case is it correct to assume there won't be a callback from rxdb if the local db already has the "winning" revision?

    pwcsolutions
    @pwcsolutions
    Can someone explain to me how to use pouchdb-authentication as a plug-in with rxdb? I’ve declared it but can’t figure out how to use the signin, register etc. functions
    Jega
    @jega-ms
    I've to build a electron desktop applications with help of RXDB, could you please suggest me which adapter I've to use , my application store more 2Gb of data ?
    pubkey
    @pubkey
    @jega-ms I think leveldown with the remote-API is the way to go
    pwcsolutions
    @pwcsolutions
    @pubkey is there a way for find() to NOT find deleted documents when filtering by id?
    const foundItem = await userCollection.findOne({ _id: { $eq: req.id } })
    this seems to return documents that I have deleted. I can understand why, just wondering if there is an extra filter or something I can use
    pwcsolutions
    @pwcsolutions
    interestingly, if i restart node, the findOne no longer finds the deleted record
    pubkey
    @pubkey
    find does not return deleted documents
    if it does that is a bug
    George Sofianos
    @sofiageo

    Hello, I'm very new to RxDB. I'm using RxDB with react-native and Typescript. I have some questions if someone can help. I'm using the pouchdb adapter with react-native-sqlite.

    1) I have about 4000 documents that i need to bulk insert / update. I'm currently using the pouch.bulkDocs function because atomicUpsert is super slow. My understanding is that this function will keep inserting documents even if they have the same id. Is there a way to only keep the latest document data?

    2) I'm confused about creating queries. Should I look at the pouchDB documentation or at the cloudant/mango repo? I'm trying to combine a where() with a sort() and a limit() but it won't run as it is too complex. If I remove sort() it runs fine.

    3) Are there any performance documentation / tips? I'm seeing some small delays that are not visible for example with redux, so I might be doing something wrong.

    4) Is the schema necessary or I can use RxDB without a schema? If it's not necessary what features do I lose without it? I'm still not very experienced with the schema so some things are more hard than they should. For example Documentation says I can define Indexes for string, integer, number but I get an error for any type except string.

    Thanks

    George Sofianos
    @sofiageo
    about 2) - I'm getting the same error as Bastien https://gitter.im/pubkey/rxdb?at=5e1b28e53254b6754c96a247 - Too many SQL variables. I get it with both RxDB + pouchDB query.
    pubkey
    @pubkey
    @sofiageo
    1) You should use the bulk-methods for writing that many documents. RxDB also has a bulkInsert(). The upsert function will overwrite existing documents with the same primary key
    2) I never had this problem. If you can reproduce it, you should create an issue. If it is also not working with pouchdb, create an issue there because it must be fixed there.
    3) There are some performance-tips for pouchdb that also apply to rxdb https://pouchdb.com/2015/09/01/pouchdb-4.0.1-gotta-go-fast.html
    4) yes you need a schema. Most configuration and optimisations that come from RxDB rely on having a schema. If creating these indexes does not work, please make an issue with some code to reproduce it
    Over all I must say that I am just a single human. I maintain my own projects but I have not enough time to fix pouchdb-problems. They have maintainers and pouchdb-bugs should be reported there
    George Sofianos
    @sofiageo
    thanks @pubkey - I will try to get a better understanding of what's wrong first then I will create any issues. Just to be clear, when I type collection.pouch that means it is directly using the pouchDB api so these issues should be reported to pouchdb?
    pubkey
    @pubkey
    Yes
    George Sofianos
    @sofiageo

    Hi again, I noticed in the documentation this part:

    Please always ensure that your pouchdb adapter-version is the same as pouchdb-core in the rxdb package.json. Otherwise you might have strange problems

    I noticed that RxDB is using version 7.0.0 of pouchdb-find but 7.1.1 pouchdb-core. I updated the library depencency but it didn't fix my issues. Then I also noticed that the pouchdb adapter (which is at version 2.0.0) has also a dependency on version 7.0.0 of websql-core.

    Could this version difference create the issues? If yes, I can try to fork the pouchdb adapter and try to update its dependencies.

    George Sofianos
    @sofiageo
    It looks like gaodeng has already done the job - https://github.com/gaodeng/pouchdb-adapter-react-native-sqlite - I will give it a try. Maybe this monolog helps someone else too :)
    George Sofianos
    @sofiageo
    Yeap, it looks like it's working. No more errors and sorting works. Still a bit slow though
    pubkey
    @pubkey
    @sofiageo shouldnt there be an open issue in the adapters repo?
    George Sofianos
    @sofiageo
    There isn't one, I'm making one now in case craftzdog wants to merge the changes
    pubkey
    @pubkey
    great
    George Sofianos
    @sofiageo
    Hello again, I have a question, are indexes supposed to be working inside array objects? I copied an example here
    pubkey
    @pubkey
    I think they should work
    George Sofianos
    @sofiageo

    hm, it doesn't work for me, either in a test or in actual code. Maybe I'm typing something wrong in the schema?

    The error I get is:

    SchemaCheck: given index is not defined in schema - Given parameters: {key:"documents.items.title"}

    pubkey
    @pubkey
    please make a PR with a failing test
    jan-kacina
    @jan-kacina
    Hi guys, is there planned bulkUpdate method in near future? Or is there any other plugin/fork with this function? I have built my reactive application on RxDB (with no prior experience) and now I'm facing performance issues during document updates - update about 100 documents in 2 collections takes about 5 secs and the time is increasing with number of document revisions...
    pubkey
    @pubkey
    There are plans for more bulk operations, but this will not come in the near future. You can make a PR or use the pouchdb instance directly as a workarround