LearnNewsExamplesServices
Frontmatter
id8238
title[Neural Link] Implement toJSON in collection.Base
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 31, 2025, 4:49 PM
updatedAtDec 31, 2025, 4:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/8238
authortobiu
commentsCount1
parentIssue8200
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 31, 2025, 4:57 PM

[Neural Link] Implement toJSON in collection.Base

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 31, 2025, 4:49 PM

Implement the toJSON method in src/collection/Base.mjs to support the Neural Link serialization protocol.

It should return an object containing:

  • Properties from super.toJSON()
  • count
  • keyProperty
  • sourceId
  • filters (serialized via toJSON or export)
  • sorters (serialized via toJSON or export)

Decision: We will NOT serialize the full items array in toJSON to avoid performance issues with large datasets (e.g., buffered grids). Data inspection should be handled by specialized tools fetching data on demand.

tobiu added the enhancement label on Dec 31, 2025, 4:49 PM
tobiu added the ai label on Dec 31, 2025, 4:49 PM
tobiu added parent issue #8200 on Dec 31, 2025, 4:50 PM
tobiu referenced in commit e34a2ad - "feat(collection): Implement toJSON in Collection, Filter, and Sorter for Neural Link (#8238, #8239, #8240)" on Dec 31, 2025, 4:56 PM
tobiu assigned to @tobiu on Dec 31, 2025, 4:56 PM
tobiu
tobiu Dec 31, 2025, 4:57 PM

Input from Gemini:

✦ I have implemented the toJSON method in src/collection/Base.mjs. It returns:

{
    ...super.toJSON(),
    count      : this.count,
    filters    : this.filters.map(filter => filter.toJSON()),
    keyProperty: this.keyProperty,
    sorters    : this.sorters.map(sorter => sorter.toJSON()),
    sourceId   : this.sourceId
}

Important: We deliberately exclude items to avoid massive payloads. Data inspection should be handled via specialized tools or getRecord requests. Filters and sorters are recursively serialized.

tobiu closed this issue on Dec 31, 2025, 4:57 PM
tobiu referenced in commit ad471ec - "docs(issue): Close tickets #8238, #8239, #8240" on Dec 31, 2025, 4:59 PM