Bookmark
1. What is a Bookmark?
Bookmark lets a user save MCQs for later and organize them into collections. It’s the student’s personal shelf — separate from publishing / curation.
Two concepts to keep straight:
- Bookmark — a single record marking one MCQ as saved by one user.
- Collection (a.k.a. “bucket”) — a user-owned named folder that groups bookmarked MCQs (e.g. “Revise before exam”). Every user automatically gets one default “All Bookmarks” collection per course.
Bookmarks today apply to MCQs only.
2. Connection With Other Entities
┌────────────┐
│ USER │
└─────┬──────┘
│ owns
│
├──────────────────────────────┐
▼ ▼
┌────────────┐ groups ┌────────────┐
│ COLLECTION │ ──────────────▶│ BOOKMARK │
│ (bucket) │ │ (record) │
└────────────┘ └─────┬──────┘
│ points at
▼
┌────────────┐
│ MCQ │
└────────────┘
Bookmark state is also mirrored onto MCQ ATTRIBUTES
(`bookmark_status` + `bookmark_collection_ids`) so the
mobile sync can deliver attempts + bookmarks in one payload.
In plain English: every User owns many Collections and many Bookmark records. A Collection groups bookmark records. Each Bookmark points at one MCQ. The same state is denormalized onto the user’s MCQ Attributes row for fast mobile sync.
Everything is course-scoped: collections and bookmarks for NEET are separate from UPSC, even for the same user.
3. Parameters
3.1 Bookmark record fields
_id— unique IDunique_key— composite key of the form{course_id}_{user_id}_{content_id}; guarantees one bookmark row per user per MCQ per course; primary index for fast lookupsuser_id— the user who owns this bookmarkcontent_id— id of the saved MCQcontent_short_uid— short UID of the saved MCQ (e.g.MCQ3QJKBYM); used for cross-references and deep linkingis_bookmark—trueif currently saved,falseif the user unbookmarked it; row is retained either way for history and countscourse_id— the course this bookmark belongs to (NEET, UPSC, etc.); used for scopingis_deleted— soft-delete flagcreated_at/updated_at— epoch-µs timestamps (UTC);updated_atadvances on every togglecreated_by/updated_by— user IDs of the actor (usually the same asuser_id)
3.2 Collection (bucket) fields
_id— unique MongoDB IDshort_uid— auto-generated unique ID likeBMC3QJKBYM; used for cross-references and deep linking from clientsuser_id— the user who owns this collectionis_default—truefor the auto-created “All Bookmarks” collection (exactly one per user per course; cannot be deleted)name— collection name, 1–150 charactersdescription— optional, max 500 characterscourse_id— the course this collection belongs to; collections do not span coursesmcq_count— denormalised count of MCQs currently in this collectionis_deleted— soft-delete flag; cascades to strip this collection’s id from anymcq_attributes.bookmark_collection_idsthat referenced itcreated_at/updated_at— epoch-µs timestamps (UTC)created_by/updated_by— user IDs of creator / last editor
4. Functionality
- Bookmark / Unbookmark an MCQ
- Add a bookmarked MCQ to one or more collections
- Move bookmarked MCQs between collections
- Create a new collection
- Rename / edit a collection
- Delete a collection — cascade strips the collection id from affected MCQ attributes; underlying bookmark records survive
- Default “All Bookmarks” collection — auto-created per user per course; cannot be deleted
- Sync collections + bookmark state for offline (mobile)