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

Support Smart Collections #12

Closed
wizonesolutions opened this issue Aug 15, 2013 · 8 comments
Closed

Support Smart Collections #12

wizonesolutions opened this issue Aug 15, 2013 · 8 comments

Comments

@wizonesolutions
Copy link
Contributor

https://github.com/arunoda/meteor-smart-collections

Only Meteor.Collection gets mutated by this package, so I can't switch to SmartCollections yet.

There could well be a separate package like meteor-smart-collection-hooks — I haven't assessed the difficulty of this at all, and I don't know if Smart Collections have any high-level implementation differences that would invalidate the current approach used to hijack Meteor.Collection.

cc @arunoda

@mizzao
Copy link
Contributor

mizzao commented Aug 15, 2013

If anything, I think the right approach would be to integrate hooks into smart collections themselves rather than using the monkey-patching approach here. There are two reasons for this. First, they are not part of core, so using a top-to-bottom programming approach would be easier to push through. Second, it would further raise the benefits of smart collections so that core would really have to consider bringing them in along with the collection hooks.

Also, see https://groups.google.com/forum/#!topic/meteor-core/jG1KLObX1bM

@matb33
Copy link
Collaborator

matb33 commented Aug 16, 2013

I looked through @arunoda's code quickly and it seems I might be able to plug some hooks into his infrastructure more easily than with core. Not 100% sure yet, was just a quick glance. Should be doable

@gabrielhpugliese
Copy link

Arunoda will not make any more features for SC. I don't think this makes sense anymore. What you think ?

@matb33
Copy link
Collaborator

matb33 commented Oct 11, 2013

Agreed

@matb33 matb33 closed this as completed Oct 11, 2013
@wizonesolutions
Copy link
Contributor Author

Ah. Is Smart Collections going into core or something? cc @arunoda

@arunoda
Copy link

arunoda commented Oct 11, 2013

Nop. SmartCollections will not going into core. But smart collection's core feature oplog support will be come with Meteor 1.0
So SmartCollections can retire peacefully after that :)

I used it in production and some other people use it, since it's the only way we can scale meteor now. But SmartCollections have limitations and it's does not have full meteor feature set. So once 1.0 comes we all can safely move into that.

@craig-l
Copy link

craig-l commented Dec 26, 2013

Sort of related..
A lot of people are using collection2 so I wanted to share how I was working with both packages...

testCollectionBase = new Meteor.Collection("testCollection");
testCollectionBase.after.insert( function (userId, doc) {
    console.log("This was inserted:");
    console.log(doc);
});

testCollection = new Meteor.Collection2(testCollection, {
    schema: {
        name: {
            type: String,
            label: "Name"
        }
    }
});

Is there anything wrong with doing this?
If not maybe add it to the readme as I'm sure most people will be extending standard collections.

p.s. I'm new to github so hopefully this is a good place to post this.

@matb33
Copy link
Collaborator

matb33 commented Dec 31, 2013

@craig-l you're approaching it correctly. Simply having you post this here may be enough for people to find. If people continue to be confused with how to have Collection2 interoperate with collection hooks, I'll consider a note

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

6 participants