Skip to content

Feature: Ability to define type of every key-value field in an object #4060

Closed
@jquesada2016

Description

@jquesada2016

Describe the bug

It seems like there's a bug when calculating object paths that prevents one from using arbitrary keys for an object while defining the key's type.

Steps to reproduce

Take the following schema:

DEFINE TABLE test SCHEMAFULL;

DEFINE FILED obj ON test FLEXIBLE TYPE object;
DEFINE FILED obj.* ON test TYPE string;

Doing the following fails, but should work:

CREATE test SET obj = {};

And likewise the following:

CREATE test SET obj = { a: "blah", b: "lah" };

Expected behaviour

I expect to be able to define a schema for an object field that can have arbitrary keys, but still define the sub-field types.

SurrealDB version

SurrealDB command-line interface and server 1.5.0 for linux on x86_64

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

topic:schemaThis is related to schema definition and enforcement, and root/namespace/database level issuestopic:surrealqlThis is related to the SurrealQL query language

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions