Keep database only on the server

I would like to keep a library of images only on the server. How do I deal with that?

Have you removed the autopublish package?

Data is only given to the client when you subscribe to a data set, or when you have autopublish enabled.

If you create a mongo collection and never publish data from it, for all intents and purposes, it is “server only”

If you want to use an in-memory only collection, you can: ServerImages = new Mongo.Collection()

I have difficulties understanding how Meteor handles data in the database. When does it actually save it on the client?

Yes, autopublish is removed.

When does it actually save it on the client?

Depends on what you mean. When you use publish/subscribe, the publish function defines the data set that will be given to the client. The client downloads this data set to local storage, more or less.

// this will give all users to the client
Meteor.publish('users', function () {
  return Meteor.users.find();
// this will only give a subset of the users collection to the client
// only users with the specified name.
Meteor.publish('usersByName', function (name) {
  check(name, String);
  return Meteor.users.find({
    '': name

You can read the collections and data loading articles in the meteor guide for a lot of details!

This is the new official guide in case you haven’t seen it, there’s a lot of really helpful stuff in there:

Thank you for the input.