Logo
Section 1 / 5

示例基本指南

熟悉本课程中将使用的数据库名称、集合名称以及集合中的字段。

导入

示例基本指南

熟悉本课程中将使用的数据库名称、集合名称以及集合中的字段。

预先定义重要术语

以下为数据库和集合的名称,这些名称将在本课程的示例中使用。

  • 数据库名称:todo
  • 集合:tasks 和 users
  • 集合结构(Schema):大多数操作将使用以下结构:
1{ 2 _id, 3 name, 4 description, 5 due_date, 6 completed_date, 7 priority, 8 status, 9 is_public, 10 progress, 11 user, 12 team: { 13 id, 14 location: { 15 address, 16 lat, 17 lng, 18 }, 19 }, 20 assignee: { 21 id, 22 username, 23 }, 24 num: [], 25 tags: [], 26 categories: [{ 27 id, 28 key, 29 score, 30 }, { 31 id, 32 key, 33 score, 34 }] 35}

数据库与MongoDB简介

创建和删除 MongoDB 数据库