Skip to content

Bug: Javascript SDK Functions | .create | Table Object Passed as Query Bind Issue #555

@SoulThread2597

Description

@SoulThread2597

Describe the bug

Im running SurrealDB 3.0.0 with SurrealDB's npm package version 2.0.0-beta.2.

My question is in regards to create function that is provided. In this beta version the second argument of data is removed, and is instead replace with .content(..) after the create is called. There is no documentation that i have found that explains this but based on logic and reasoning, thats what ive assumed. I continuously keep getting this error Cannot execute CREATE statement using value: { }. Ive tried many different ways of setting it up, and im just lost what its complaining about. If someone could give me an example of it being correct and working and/or clarify that this is an actual bug, that would be great.

Steps to reproduce

Create a table called test in your database and setup the access tokens and connection system and assign the database connection to the variable called 'database'.

An example of what isn't working:

const test = await database.create(new RecordId('test', "temp")).content({
    test:"test"
});

Expected behaviour

I expect it to create a record with the id 'temp' on table 'test' with the following data:

  • test: "test"

SurrealDB version

SurrealDB 3.0.0

JavaScript SDK version

2.0.0-beta.2

Contact Details

contact@soulthread.dev

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct (repository /surrealdb.js)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions