Sunday, 9 April 2017

How to maintain user customizable order of entities in mongodb?

Suppose we have reminder list of users as -

  • Reminder 1
  • Reminder 2
  • Reminder 3

User can change order of list using drag and drop on UI. eg user drags Reminder 3 and drops in place of Reminder 1. So now and even after user refresh, list should be -

  • Reminder 3
  • Reminder 1
  • Reminder 2

How can I achieve this in mongodb efficiently ? (I'm using NodeJS with Express and Mongoose JS)



via ab-Sol-Invictus

No comments:

Post a Comment