Comments (9)
Is there currently a way to restrict certain fields from being returned from a top-level "find" even if you don't need them to run the child query? Queries such as the following don't seem to work in any context, which makes security management more difficult: db.inventory.find( { type: 'food' }, { item: 1, qty: 1 } )
from meteor-publish-composite.
Yes there is. Meteor syntax is db.inventory.find( { type: 'food' }, { fields: { item: 1, qty: 1 } } )
.
Documentation
from meteor-publish-composite.
Looks like I need to reread the docs. Thank you.
from meteor-publish-composite.
This may be somewhat related to the discussion in #28.
from meteor-publish-composite.
@reywood What are your thoughts on my PR #43 ?
from meteor-publish-composite.
It relies on the private function _compileProjection
which doesn't seem like a great idea. The Meteor folks could refactor or remove that function at any time. It also completely removes the observeChanges
handler which is a major blow to performance in the default use case. Given these issues, I think PR #43 is a non-starter.
from meteor-publish-composite.
It relies on the private function
_compileProjection
which doesn't seem like a great idea.
True - it would be possible to instead simply duplicate that function here, it's fairly simple.
It also completely removes the
observeChanges
handler which is a major blow to performance in the default use case.
I don't understand this, if anything removing the call to observeChanges
will improve performance. It's better to have one observation running rather than two, and internally observeChanges
is implemented in terms of observe
anyway.
from meteor-publish-composite.
My mistake. I missed that you moved that functionality into the other observe handler. In poking around, it looks like the Meteor folks are moving the diff logic into a separate package called diff-sequence. I was unable to add this package to a new meteor project. Perhaps it's still under development. Probably worth waiting until they've sorted that out, or, as you said, copy this new implementation until they do. I do think this is a good idea.
I'm leaning towards a transform
option rather than a fields
option. The transform
function would be used before sending the doc to the client, but the untransformed doc would be dispatched to child pubs. I think it gives the same functionality but with more flexibility. Your idea to do the diffing in the observe change handler would address the concerns I voiced in #28.
from meteor-publish-composite.
any news with internal: true
?
from meteor-publish-composite.
Related Issues (20)
- Published version on atmosphere includes `eslint` (increases package size by at least 16MB) HOT 2
- Empty children HOT 4
- Publish loses reactivity after "load more" HOT 4
- Move to Meteor-Community-Packages organization? HOT 1
- All published records removed and re-added on subsequent subscriptions in 1.7.1 HOT 4
- Error: Doc not found in list HOT 1
- Join Data from Array of ID's HOT 1
- Exception in callback of async function: TypeError: Converting circular structure to JSON HOT 2
- Declaration file for TypeScript HOT 5
- [Question] How to use it together with middleware ? HOT 1
- Full compatibility with johanbrook:publication-collector
- children function won't rerun reactively
- Meteor collection hook direct not working
- Unset fields are not unset HOT 3
- Add TypeScript types HOT 1
- Remove underscore HOT 16
- Create GitHub action to run tests HOT 3
- Publications are ready before object merges are complete since 1.8.2 HOT 11
- Unhandled promise rejection HOT 3
- Error: Doc not found in list HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-publish-composite.