-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Maybe add the ability to give names to the local collections? #31
Comments
I have the package shuttler:ref where it would be very useful. |
Yeah that's a bit tricky, I'm not entirely sure of the potential use cases (we haven't had any issues crop up relating to looking up null collections so far) |
so far I have 2 options:
|
Potentially we could allow extra naming feature for both null and named collections, this may make handling multiple connections a lot more intuitive |
Rather than passing in the connection, we can instead reference the name |
If you specified an alternate name in the options, the main will be used? |
Foo1 = new Mongo.Collection('foo', { ref: 'foo1' });
Foo2 = new Mongo.Collection('foo', { ref: 'foo2', connection: ... });
// if a 'ref' is passed in, we use that name rather than 'foo'
Mongo.Collection.get('foo1');
Mongo.Collection.get('foo2'); |
I think in that case, if you define null collections without a reference, we just ignore them |
Mongo.Collection.get('foo'); // too ? |
Should not be ignored. For example, we use custom adapter instead of DDP. |
I don't think that'd be possible due to the name clash |
Do you mean another connection? |
Yes. new Mongo.Collection(null, { connection: ourCustomDB });
Mongo.Collection.get(null, { connection: ourCustomDB }); |
In that case you would also provide a ref on instantiation just like above. Will that not work in your case? |
Yes, it was cool. Only then it is not clear for what we need the second argument of the |
Hmm, can you confirm that arbitrary options make it through to |
I think it should be alright, you will specify the |
That will solve this outstanding issue: #22 |
|
Though it would be possible to overwrite a |
It is a question of validation and comparison of patterns. |
Exit - namespace tree :) And I think this is not the exit. |
Let's go with just |
I think for backward compatibility should leave collection. |
I agree, though it's not entirely working, see here: #22 |
May be because |
Possibly. Let's continue discussion on the PR. |
Perhaps it would be necessary to add this capability. I doubt in the interface. Which of these options is more like it? How the best option to name?
localName
somehow ugly.The text was updated successfully, but these errors were encountered: