surrealdb / surrealdb.js

SurrealDB SDK for JavaScript
https://surrealdb.com
Apache License 2.0
272 stars 45 forks source link

Bug: #239

Closed vitorTheDev closed 3 months ago

vitorTheDev commented 3 months ago

Describe the bug

This query

create only recorrencia content {empresa: $empresa, mensalidade: $mensalidade, vencimento: $vencimento, tipo: 'receber', finalizado: false, parcelas: 0, parcelaAtual: 0, pessoa: null, unidade: null};

Did work before update to 1.0.0 beta4 and still works on surrealist.

However, on the beta SDK it gives me Expected a single result output when using the ONLY keyword

Steps to reproduce

Create a query with create only content clauses and send it through the beta SDK. It should give Expected a single result output when using the ONLY keyword.

Expected behaviour

Should create the record.

SurrealDB version

surreal 1.4.2 on windows 11 x64

SurrealDB.js version

1.0.0-beta4

Contact Details

netd777@gmail.com

Is there an existing issue for this?

Code of Conduct

vitorTheDev commented 3 months ago

The problem actually was that I was casting a RecordId as a RecordId (twice), which resulted in weird behavior. In my opinion class creation should error if you pass a RecordId class as id.