nlhuykhang / meteor-publish-join Goto Github PK
View Code? Open in Web Editor NEWMeteor publish join
License: MIT License
Meteor publish join
License: MIT License
You pointed out in the comment in line 31 that this method
meteor-publish-join/src/server/worker.js
Lines 21 to 34 in 2aece27
Well, I got into it. I'm currently investigating on how this could occur. Please let me know if you are suspecting something or might have a helpful insight here.
On my publication (server):
import { Meteor } from 'meteor/meteor';
import { JoinServer } from 'meteor-publish-join';
import DataTable1 from '../index';
const LIMIT = 50;
Meteor.publish('DataTable1.list', function({ projectId, type, searchText, searchFields }, { limit = LIMIT, skip = 0 }) {
if (!this.userId) {
return this.ready();
}
// TODO: validate args
const query = { projectId, type };
if (searchText?.length > 0) {
Object.assign(query, composeSearchQueryParams(searchText, searchFields));
}
const queryOptions = { sort: { createdAt: -1 }, limit, skip };
const data = DataTable1.find(query, queryOptions);
JoinServer.publish({
context: this,
name: 'DataTable1listcount',
interval: 10000,
doJoin() {
// I also tried
// return Meteor.users.find({});
// return DataTable1.find(query);
// same error
return DataTable1.find({});
},
});
return data;
});
On the client (I'm using react react-komposer):
export default composeWithTracker(({ inlineCreate, collection, page = 1, limit = 20, setPage, searchText }, onData) => {
const { projectId, type } = collection;
const subscription = Meteor.subscribe('DataTable1.list', { projectId, type, searchText:'', searchFields }, { limit, skip: (page-1) * limit });
const count = JoinClient.get('DataTable1listcount');
console.log('count', count)
if (subscription.ready()) {
const categories = DataTable1.find({ projectId, type }, { sort: { createdAt: -1 } }).fetch();
// const count = Counts.get('DataTable1.list.count');
const totalPages = Math.ceil(count/limit) || 1;
onData(null, { categories, inlineCreate, totalPages, onPageChange: setPage, searchText });
}
}, Loading)(withPagination(CollectionDataList));
But I keep getting
RangeError: Maximum call stack size exceeded
[email protected]
"meteor-publish-join": {
"version": "1.1.7",
I want to test if the outcome of my query is good. How can I do this using a test-framework?
I've tried using johanbrook:publication-collector
, which works for https://github.com/percolatestudio/publish-counts a.o. but I couldn't get it work with your plugin ...
Writing full-app-tests seems to heavy to me, since I'm sure there's also another way ...
Is there a way to query 2 collection, manipulate with the data and publish the result?
Right now I'm publishing with JoinServer 2 queries from 2 collections and doing manipulation with the data Client Side, but I want to send already prepared data.
Just a question to get this right the first time:
I'm working on a tool, where we'll have to publish a lot of these publications, often not related to a user. We'll also have quite some clients that will subscribe on those.
Will the agregation/query be re-run for every client, subscribing on this publication in the given interval, or is there a possibility, where I can save the value globally, so the next client, subscribing to it, will get the already computed one if it isn't the right time to re-run the computation?
For some reason I'm getting this error:
W20170120-17:40:14.015(0)? (STDERR) ReferenceError: Meteor is not defined
W20170120-17:40:14.015(0)? (STDERR) at Object.<anonymous> (.....\node_modules\meteor-publish-join\dist\server\index.js:49:5)
W20170120-17:40:14.015(0)? (STDERR) at Module._compile (module.js:409:26)
W20170120-17:40:14.015(0)? (STDERR) at Object.Module._extensions..js (module.js:416:10)
W20170120-17:40:14.015(0)? (STDERR) at Module.load (module.js:343:32)
W20170120-17:40:14.015(0)? (STDERR) at Function.Module._load (module.js:300:12)
W20170120-17:40:14.015(0)? (STDERR) at Module.require (module.js:353:17)
W20170120-17:40:14.015(0)? (STDERR) at require (internal/module.js:12:17)
W20170120-17:40:14.015(0)? (STDERR) at Object.<anonymous> (......\node_modules\meteor-publish-join\dist\index.js:8:15)
W20170120-17:40:14.016(0)? (STDERR) at Module._compile (module.js:409:26)
W20170120-17:40:14.016(0)? (STDERR) at Object.Module._extensions..js (module.js:416:10)
I'm using this in a Meteor project, so I'm not sure where this is coming from.
Any ideas?
Hi, thx for this great package!
But it looks like, that the publication is waiting for the interval before processing the first doJoin().
So with a interval of 30 seconds the first join is processed after 30 seconds.
Is it possible to configure that behaviour?
Today, I ran meteor npm outdated
in my repository and saw, that there is a new version - version 1.2.0
- which isn't part of this repository. Do you know anything about it? If yes, could you tag it on this repository, so I can follow along on the changes that are included there?
EDIT: I've installed this version and it didn't include the changes, done in 1.1.4
. In fact, it seems to be a version published after #4 was merged.
This shouldn't be much of an issue. Please replace the dependency node-uuid
by uuid
. The package node-uuid
is deprecated and it's features have been merged into uuid
.
i'm confused, can you make a explain for isShared and maxWaiting in readme ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.