JIO had only two methods to get or remove documents and attachments, so, if we forget to add the attachment id to the parameters, then the document will be returned or removed instead of the attachment!

To avoid it, two new methods were added: getAttachment and removeAttachment.

Use them like putAttachment, it means like this:

// to put an attachment
jio.putAttachment({
  "_id": "document id",
  "_attachment": "attachment id",
  "_data": "data",
  "_mimetype": "mime/type"
}, callback);

// to get an attachment
jio.getAttachment({"_id": "document id", "_attachment": "attachment id"}, callback);

// to remove an attachment
jio.removeAttachment({"_id": "document id", "_attachment": "attachment id"}, callback);

Of course, get and remove work only on documents now.

Documentation is up to date!

Bottom Gadget
Right Gadget