Skip to content

[BUG] Can't .findData() if queries exist for collection #26

@oceans404

Description

@oceans404

Describe the bug
The secretvaults-ts throws an error if you try to .findData() for a collection where queries exist.

How to reproduce

  1. Clone blind-module-examples repo
git clone https://github.com/NillionNetwork/blind-module-examples.git
  1. Navigate into sdk-examples https://github.com/NillionNetwork/blind-module-examples/tree/main/nildb/secretvaults-ts/sdk-examples and run the string query example - this creates a collection, creates queries, and runs queries successfully
npm run example:query-string
  1. Add this code above the CLEANUP_AFTER_EXAMPLE block to try to read all records in collection
// this will fail to read records / find data because queries exist
const readRecords = await builderClient.findData({
  collection: collectionId,
  filter: {}, // Empty filter returns all records
 });
console.log('📋 Read records:', JSON.stringify(readRecords.data, null, 2));
  1. Re-run run npm run example:query-string and see error from secretvaults-ts library:
TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)

Expected behavior
.findData() should return records even if queries exist

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions