Skip to content

Commit

Permalink
Added limits for namespace, collection & docs
Browse files Browse the repository at this point in the history
resolves #135
  • Loading branch information
amorton committed Feb 21, 2023
1 parent 7fb03f8 commit 3335c48
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/jsonapi-spec.textile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,36 @@ h2(#namespace). Namespace

*TODO:* define the namespace, it's properties etc . Do we define how to create one ?

h3(#namespaceLimits). Namespace Limits

h4(#namespaceLimitsName). Namespace Name Limit

Namespace names must follow the regular expression pattern below:

_Syntax:_

bc(syntax)..
<namespace-name> ::= [a-zA-Z][a-zA-Z0-9_]*

p. The maximum length of a namespace name is 48 characters.

h2(#collection). Collection

*TODO:* define the collection, it's properties etc . Do we define how to create one ?

h3(#collectionLimits). Collection Limits

h4(#collectionLimitsName). Collection Name Limit

Collection names must follow the regular expression pattern below:

_Syntax:_

bc(syntax)..
<collection-name> ::= [a-zA-Z][a-zA-Z0-9_]*

p. The maximum length of a collection name is 48 characters.

h2(#document). Documents

*TODO:* Describe how do we define a document and then refer to the parts of a JSON document, e.g. key or path etc ?
Expand Down Expand Up @@ -159,6 +185,35 @@ bc(sample)..
}
}

h3(#documentLimits). Document Limits

JSON documents must ahere to the following limits. Attempting to insert or modify a document beyond these limits will result in the command failing.

h4(#documentLimitsSize). Document Size Limit

The maximum size of a single document is 1 megabyte. The size is determined by the JSON serialisation of the document.

h4(#documentLimitsDepth). Document Depth Limit

The maximum nesting depth for a single document is 8 levels deep. Each nested docment or array adds another level.

h4(#documentLimitsFields). Document Field Limits

The maximum length of a "field name":#documentFieldNames is 48 characters.

The maximum number of fields allowed in a single JSON object is 32.

This comment has been minimized.

Copy link
@amorton

amorton Feb 21, 2023

Author Contributor

change max numb fields to 64

see example here for complexity https://github.com/jdorfman/awesome-json-datasets


h4(#documentLimitsValues). Document Value Limits

The maxium size of field values are:

|_. JSON Type |_. Maximum Value |
| @string@ | Maximum length of 4096 unicode characters |

This comment has been minimized.

Copy link
@amorton

amorton Feb 21, 2023

Author Contributor

Change to 16K

| @number@ | Arbitrary sized number described using "BigDecimal in Java":https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html#BigDecimal-java.lang.String- |

This comment has been minimized.

Copy link
@amorton

amorton Feb 21, 2023

Author Contributor

NOTE: talk to @tatu-at-datastax about what the limit should be.


h4(#documentLimitsArray). Document Array Limits

The maximum length of an array is 100 elements.

h2(#commands). Commands

Expand Down

0 comments on commit 3335c48

Please sign in to comment.