Code Monkey home page Code Monkey logo

Comments (6)

aldeed avatar aldeed commented on May 21, 2024

Hmm, yes that line might be backwards, and should probably check for the key plus "[" as well as an exact match, something like:

if (p === position || p.slice(0, position.length + 1) === position + "[") {

Basically the slice stuff is there because if we delete a property's value and that value was an array or object, then we need to be sure to delete everything that was within that array or object, too.

I'll have to add some tests, make this change, and make sure this fixes it.

from meteor-simple-schema.

mjgallag avatar mjgallag commented on May 21, 2024

Ah, I see, thanks!

from meteor-simple-schema.

mjgallag avatar mjgallag commented on May 21, 2024

@aldeed I ran into another issue with virtual fields that I didn't get entirely to the bottom of. I had two different collection2's race & result. race had virtual fields and result did not. Under certain circumstances race's virtual field functions were being passed results. I spent some time trying to get to the bottom of it and I could clearly see a result being passed to a race virtual field function in the debugger. Due to the fact that virtual fields are probably being deprecated and collection-helpers was the recommended replacement I decided to go ahead and make the switch rather than debug the issue further and so far so good!

from meteor-simple-schema.

aldeed avatar aldeed commented on May 21, 2024

@mjgallag, that's strange. Virtual fields are implemented through the collection's transform option, and the object passed in to the virtual field function is actually the same object being passed to the transform function. So one interesting test would be to see if you can replicate with a custom transform function and a normal schemaless collection. In other words, it might be a general issue with transforms in the mongo-livedata package, so that should be ruled out first.

from meteor-simple-schema.

mjgallag avatar mjgallag commented on May 21, 2024

If it helps at all the issue was around here: https://github.com/aldeed/meteor-collection2/blob/master/collection2.js#L35 the doc was from one collection2 and the virtualFields were from another. When I switched to collection-helpers the issue went away. I'm willing to revert back to Virtual Fields temporarily to help you test fixes if you're interested, just let me know. Wasn't sure how much time you wanted to spend if you were deprecating them anyway, and like I said, collection-helpers is working well for me so far. Thanks!

from meteor-simple-schema.

aldeed avatar aldeed commented on May 21, 2024

We can wait and see if anyone else reports this issue. As you said, using collection-helpers is better anyway.

from meteor-simple-schema.

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.