question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs embedded in object w/ arbitrary keys?

See original GitHub issue

Is there a way to use embedded docs within a object that doesn’t have predetermined keys? i.e. Rather than having a situation like this:

var myschema = new mongoose.Schema({
   field : { foo: String, bar: String }
});

Being able to say something like:

var myschema = new mongoose.Schema({
   field : { *: String }
});

Makes it a little more array like in that way - but the idea is that I don’t know the keys in advance, but I’d still like to be able to have an embedded doc.

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Reactions:25
  • Comments:40 (5 by maintainers)

github_iconTop GitHub Comments

25reactions
doneumarkcommented, Mar 10, 2018

This feature is a MUST.

10reactions
raubcommented, Sep 27, 2017

@qqilihq, do implement plx, then we stop +1, kthxbye

Read more comments on GitHub >

github_iconTop Results From Across the Web

Arbitrary schema keys - Google Groups
I've got a design I'm attempting to define in a JSON schema, but I'm not exactly sure how to represent it. Our JSON...
Read more >
Document structure of a value for arbitrary keys in an Object in ...
I'm mainly concerned about it working in VSCode which lifts these type definitions from JSDoc. javascript · documentation · jsdoc · Share.
Read more >
Is there a type for objects with arbitrary keys and values?
I am looking for a type that describes objects with arbitrary keys and values, where values can only be basic types ( string...
Read more >
Query nested objects in a document with unknown key
Hi,. I have a collection with many documents that do have a “item” property where the value is an object with key-value-pairs:
Read more >
Indexing and Searching Arbitrary JSON Data using ... - smnh
In this document, every object in the flatData array represents a leaf node in the original document and has the following fields: key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found