Can't hash a map

Here is the code:

//int hash() | Takes in any data type and encodes it into an integer value. |
return hash({key: 'Value', listKey: [{inner: 'Map1'}, {inner: 'Map2'}]})


[ERROR (-12)]: SemanticError: `hash({key:"Value",listKey:[{inner:"Map1"},{inner:"Map2"}]})' is not a valid expression : Parameter's type error

Hi there! The hash() function cannot hash a map. For what it can do, see the hash doc.

1 Like

If you need to hash maps, could you please submit an issue and share your scenario?

The hash function only supported int/float/string/bool/date/datetime/path/vertex/edge/list/NULL. Just the MAP and SET is not supported.

1 Like

I don’t have a clear use case for hashing maps yet, will submit an issue once I do.

The documentation is not accurate here:

Thanks for your feedback. We will modify the document as soon as possible.