Quill: Saving document to JSON

Created on 9 May 2014  路  2Comments  路  Source: quilljs/quill

can I save this document to some sort of JSON format to save in Mongodb?

Most helpful comment

Yes you can use getContents to get a Delta object which looks something like this:

{
  startLength: 0,
  endLength: 10,
  ops: [
    { text: 'Hello' },
    { text: 'Quill', { bold: true } }
  ]
}

The reason it's not just a vanilla object is because we attached some useful functions to it but if you want to just store the data this should be what you're looking for.

All 2 comments

Yes you can use getContents to get a Delta object which looks something like this:

{
  startLength: 0,
  endLength: 10,
  ops: [
    { text: 'Hello' },
    { text: 'Quill', { bold: true } }
  ]
}

The reason it's not just a vanilla object is because we attached some useful functions to it but if you want to just store the data this should be what you're looking for.

Feel free to reopen if this isn't what you're looking for.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benbro picture benbro  路  3Comments

emanuelbsilva picture emanuelbsilva  路  3Comments

rsdrsd picture rsdrsd  路  3Comments

lustoykov picture lustoykov  路  3Comments

splacentino picture splacentino  路  3Comments