Skip to content

[BUG] BsonRef Self Ref outoverflowexception #2310

@sgf

Description

@sgf

Version
ver 5.0.16

Describe the bug

public class Package {

[BsonRef()]
public Package Parent{get;set;}

public List<Package>Childs {get;set;}

}

#975
#2265

Code to Reproduce

var col= db.GetCollection();//error here

Expected behavior
code execute pass

Screenshots/Stacktrace

image

Additional context

This problem is caused by circular references. But reasonable citations should often be allowed. For example, father and son. But I believe this kind of reference should have some exit mechanism. For example: parent node, child node must be finite. Therefore, I suggest a limit on the number that can be used with the Attribute token exit mechanism. For example: increase the reference depth for the specified field:
BsonRef(limit=1024)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions