Pavan Kumar
Pavan Kumar

Reputation: 1891

Meteor service-configuration package collection

When we execute the following code where does configuration get stored. In other words what is the collection name where configuration gets stored.

ServiceConfiguration.configurations.upsert(
    { service: "weibo" },
    {
        $set: {
            clientId: "1292962797",
            loginStyle: "popup",
            secret: "75a730b58f5691de5522789070c319bc"
        }
    }
);

Is there a way to change to name of collection where Service Configurations are stored.

Upvotes: 2

Views: 1488

Answers (2)

Sudhanshu
Sudhanshu

Reputation: 457

It's been ages, but if someone needs it, following is the way:

ServiceConfiguration.configurations = new Mongo.Collection(
    'custom_name', {
        _preventAutopublish: true,
        connection: Meteor.isClient ? Accounts.connection : Meteor.connection,
    }
);

It should be one of the first codes executed (probably top of your server/index file).

Source: https://github.com/meteor/meteor/blob/devel/packages/service-configuration/service_configuration_common.js

Upvotes: 1

saimeunt
saimeunt

Reputation: 22696

The name of the collection is :

"meteor_accounts_loginServiceConfiguration"

You can get this name using :

ServiceConfiguration.configurations._name

Upvotes: 4

Related Questions