Mochi
 

How to import new cards with attachments using .mochi format?

How to import new cards with attachments using .mochi format?

Hello!

I want to export a batch of prepared cards with attachments into the existing deck without touching the existing cards or their reviews.

As I understand, the optimal way is to use the .mochi file.

I checked https://mochi.cards/docs/import-and-export/mochi-format-reference/, and see that :cards are allowed at the top level of data.json, but when I tried to build such data.json manually by

  • making a deck with one card, exporting it, deleting the card in app,
  • in exported data.json
    • moving :cards to top level from the deck
    • removing :templates
    • and removing :decks

I expected that would work, but when I try to import, app sees 0 cards there, so nothing is imported.

Can you please give example of two .mochi files:

  • one makes empty deck
  • second adds one card with attachement to that deck ?

Thanks.

It seems like the importer not recognizing the top-level :cards key is a bug. I will push an update for that soon.

Update: Fixed this in v1.20.10. Also added support for attachments in CSV imports.