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

get the collection? #145

Open
meecect opened this issue Mar 4, 2022 · 1 comment
Open

get the collection? #145

meecect opened this issue Mar 4, 2022 · 1 comment

Comments

@meecect
Copy link

meecect commented Mar 4, 2022

Is there a way to get the mongo/meteor collection for cronHistory? I need to specify the collection to pass along to a datatables component. If I try to create the collection manually like

export const CronHistory = new Mongo.Collection('cronHistory');

It complains that there is already a collection.

Error: There is already a collection named "cronHistory";

In the past, I have looked here:

Meteor.connection._stores[]

But I do not see the collection there.

@kartboy16
Copy link

You can get the collection by calling
import { SyncedCron } from 'meteor/littledata:synced-cron';
const cronHistory = SyncedCron._collection
return cronHistory.find().fetch()

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

2 participants