Do Objects count towards Sanity's Document limit?

3 replies
Last updated: Mar 21, 2024
Hey all. Just wondering if Objects contribute to Sanity's Document limit for a given pricing tier or not? Thanks!
AI Update

No, objects do not count toward Sanity's document limit for a given pricing tier!

Here's the key distinction:

What counts as a "document":

  • Only document types count toward your document limit
  • Document types are top-level content structures that have type: 'document' in your schema
  • They appear in your Studio sidebar and have system fields like _id, _rev, _createdAt, etc.
  • Examples: pages, blog posts, products, authors

What doesn't count:

  • Object types - These are reusable schema structures used within documents (like address objects, SEO metadata objects, etc.)
  • They don't exist independently and can't be created as standalone content
  • They're just structured data nested inside documents

Document limits by plan: According to the technical limits documentation:

  • Maximum documents: 10 million (customizable for Enterprise customers)
  • Free plan: 2,000 unique attributes
  • Growth plan: 10,000 unique attributes
  • Enterprise plan: Custom attribute limits

What you should be aware of: While objects don't count as documents, they do contribute to your attribute limit. An attribute is any unique path/datatype combination across all documents in your dataset. So if you have complex nested objects with many fields, those fields count as attributes.

For example, an array like [2.718, 3.14, "abc", "def", true] counts as 4 attributes (1 for the array itself, plus 3 for the datatypes: float, string, and boolean).

Bottom line: Use as many object types as you need to structure your content effectively - they won't eat into your document count, only into your attribute limit, which is typically quite generous.

Show original thread
3 replies
No. Only documents.
Apart from there being a limit on number of attributes which you might butt up against if having lots of nested fields
Thank you! Yeah - a bit concerned about that attribute limit. Might become an issue.

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?