Docs Menu

Docs HomeRealm

Specify an Optional Property - React Native SDK

On this page

  • Overview

To mark a property as optional, append a question mark ? to its type.

Example

The following schema defines a DogSchema with the optional property breed of type string.

const DogSchema = {
name: "Dog",
properties: {
breed: "string?"
}
};
←  UUID - React Native SDKSpecify a Primary Key - React Native SDK →

On this page

Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.