Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Storing 'Ner' object in Mongodb

I am trying to store a 'js' object in Mongodb collection. This is a 'Ner' object to extract custom entities from a sentence:

  container: Container {
    classes: {},
    factory: {
      logger: [Object],
      fs: [Object],
      arrToObj: [Object],
      normalize: [Object],
      objToArr: [Object],
      stem: [Object],
      removeStopwords: [Object],
      tokenize: [Object],
      timer: [Object],
      storage: [Object],
      'extract-enum': [Object],
      'extract-regex': [Object],
      'extract-trim': [Object],
      'extract-builtin': [Object]
    },
    pipelines: {},
    configurations: {},
    compilers: { default: [DefaultCompiler] },
    cache: { bestKeys: {}, pipelines: [Object] },
    parent: undefined
  },
  settings: {
    container: Container {
      classes: {},
      factory: [Object],
      pipelines: {},
      configurations: {},
      compilers: [Object],
      cache: [Object],
      parent: undefined
    },
    tag: 'ner'
  },
  rules: { en: { hero: [Object] } },
  pipelineProcess: undefined
}

I want to store this in a collection in Mongodb. The problem is, this object cannot be directly stored because it results in a cycle detection error therefore I need to convert it to JSON first, but stringifying it results in {"settings":{"tag":"ner"},"rules":{"en":{"hero":{"name":"hero","type":"enum","rules":[{"option":"spiderman","texts":["spiderman","spider-man","Peter Parker"]}]}}}} which is incomplete and it cannot be parsed back to it's original form. Is there any way to store the object in it's original form in the db to avoid all the issues.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!