Reywood:publish-composite

I’m start to use reywood:publish-composite

I get a strange behaviour:
If I add in the children the same collection with different fields I get the publication well but if I connect with another collection I do not get the data of the second.

// this works well, I can get fields from children

publishComposite("objects", function(options) {

  return {
    find() {
      return Objects.collection.find({}, { fields: { fieldOne: 1 } });
    },
    children: [{
      find(object) {
        return Objects.collection.find({ _id: object._id }, { fields: { fieldTwo: 1 } });
      }
    }]
  }
});



// this don't works well, I can't get fields from children

publishComposite("objects", function(options) {

  return {
    find() {
      return Objects.collection.find({}, { fields: { fieldOne: 1 } });
    },
    children: [{
      find(object) {
        return ObjectModels.collection.find(object.objectModelId);
      }
    }]
  }
});

Does anyone have any experience with this ?

return Objects.collection.find({}, { fields: { fieldOne: 1 } });
this limits the result of object to only have _id and fieldOne,
You need to add objectModelId too to make it work:
return Objects.collection.find({}, { fields: { fieldOne: 1, objectModelId:1 } });

Yes, you are right, I remove too fields in my example…
The example is:

publishComposite("objects", function(options) {

  return {
    find() {
      return Objects.collection.find({}, { fields: { fieldOne: 1, objectModelId: 1, serial: 1 } });
    },
    children: [{
      find(object) {
        return ObjectModels.collection.find(object.objectModelId,  { fields: { name: 1) });
      }
    }]
  }

Unfurtunaly also this won’t works.