cancel
Showing results for 
Search instead for 
Did you mean: 

New constraint - value limits and limitations

support1
Node Link

Environment Info
Currently using v4.2.3 - Community.
Attempting the following via the browser interface.
No use of add-ins.

What I am trying to achieve
Looking to create a constraint for a unique value, using the following code
CREATE CONSTRAINT constraint_urivalue IF NOT EXISTS ON (u:uri) ASSERT u.value IS UNIQUE

The Error
Property value is too large to index , please see index documentation for limitations. Index: Index( id=9, name='constraint_urivalue', type='UNIQUE BTREE', schema=(:uri {value}), indexProvider='native-btree-1.0' ), entity id: 1752159, property size: 8349, value: [String("https://app.example.com/r?target=5fdb4af6c9e87c0045712071&t=AFwhZf1jxnSLg3hAmBOGQE4BcG....

After searching through the knowledgebase, I found this article which explains that the size limit is 8167 bytes (and instructions how to work out the size of any particular value).
however this article has left me with the following questions about proceeding.

The Question(s)

  1. Is this node the only size limitation causing this error, or does neo4j simply stop after the first problem and return that error without checking the remaining conflictions?
  2. If I delete this particular node, and then create the index (assuming there is no other confliction as per Q1). Then later on I tried to add this node or a similar sized node, into the database, what would happen (e.g. truncate my value, break the index, error and not create the node, etc.) ?
  3. Any workarounds or solutions you may have thought of - all thoughts appreciated!

Many thanks in advance!

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.