Code Monkey home page Code Monkey logo

Comments (7)

sheppe avatar sheppe commented on May 21, 2024

The work around that I'm using is to use the selector parameter of the $collection initializer, as documented at http://angularjs.meteor.com/api/collection. I pass the exact parameters to that as I am to the publisher, and the subset is returned as expected.

I don't know if there are performance implications by doing it this way, as I haven't examined the code to see where the request is run, but at least it's a work around.

from angular-meteor.

sheppe avatar sheppe commented on May 21, 2024

Looks like the work around isn't so great. Trying to update a collection bound in this way just leads to the document being deleted rather than updated.

from angular-meteor.

Urigo avatar Urigo commented on May 21, 2024

@sheppe I've just tested the subscribe parameter and it works..

Can you add a MeteorPad and maybe I can help more?

Maybe you are subscribing in another place to the same collection?
Remember, Meteor aggregates all the information from the collection that got to the client at any point in time so all the information might be coming from another subscription in your code.

Another thing is to check is you removed the autopublish package..

from angular-meteor.

sheppe avatar sheppe commented on May 21, 2024

It's a little too complex for a meteor pad, but clearly I'm doing something wrong.

I only reference the publishers in one controller, but there are three different publishers referencing a single collection in that controller. Each publisher returns a different subset of results, but all of them together would end up returning everything as I have been experiencing.

Is it possible an interaction between the three publishers on a single collection is causing this? I did reduce the number of binds in the controller to use just one publisher, and it still returned all documents.

I do reference the base collection/all documents in a different view and controller. Are you saying that the publishers will not return a properly filtered set of results doing it that way? I'm fairly new to Meteor, so perhaps I've made a rookie mistake here.

Lastly, I do have autopublish removed. :)

Thanks!

from angular-meteor.

Urigo avatar Urigo commented on May 21, 2024

@sheppe exactly, the publish/subscribe mechanism is not for filtering, filtering is does on the collection (or inside the publish Method).
We are working now on adding filtering + sorting + pagination to the tutorial using this library:
https://github.com/matteodem/meteor-easy-search

Reading that library might help you better understand how it works

from angular-meteor.

sheppe avatar sheppe commented on May 21, 2024

@Urigo Okay, thanks.

For now I've just implemented custom Angular filters to display the subsets of data, and to keep the data manageable I'm using the pagination feature of $collection.bind.

Thanks for taking on this project, by the way. Angular and Meteor are two of my favourite frameworks, and combining them is brilliant!

from angular-meteor.

Urigo avatar Urigo commented on May 21, 2024

Great.
I've added a note in the documentation of $collection.bind about the subscribe parameters thanks to your issue

from angular-meteor.

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.