Questions tagged [bsondocument]
25 questions
0
votes
0 answers
Is it possible to use an integer discrimination value for mongodb java driver?
First of all, hope you are having a great day!!!
I have a class model with a POJO having nested document list which are an abstract type, like so:
public class ConfigDocument {
private List actions;
}
public abstract class…

comandantexd
- 45
- 6
0
votes
0 answers
Get the value in a nested Bson document directly (VB.NET)?
I am trying to get the value of an element in a nested Bson document using MongoDB driver.
The document outline is something like this:
_id >> 1-4OUKQQ
type >> person
name >> john
surname >> blogg
details >> { "sid" : "456", "height" : "1.8m"}
I…

David Tait
- 11
- 1
- 2
0
votes
1 answer
How to serialise / deserialise Mongo DB BSON Objects without Losing data in C#
It seems that there are a few ways to serialise/ deserialise MongoDB data to/from objects
var docs = _collection.FindAs(_document);
OR
BsonSerializer.Deserialize(doc);
OR
var myClass = new Mytype();
myClass.Name =…

Martin Thompson
- 3,415
- 10
- 38
- 62
0
votes
1 answer
MongoDB - Search on a field of type BsonDocument by their values
I have a UserInfo collection and in that there is a field called UserThemes. I want to get the users if there are themes with values greater than 100.
This is the UserInfo collection:
public record UserInfo:BaseDocument
{
public string UserName…

Kaveh Naseri
- 1,102
- 2
- 15
- 24
0
votes
1 answer
Using extended filters (by field inside field) in MongoDB
There's a list List with values like that:
{{ "_id" : 123, "IDD" : 123, "Sc" : { "Field1" : null, "Field2" : "some text|some text|"} }}
{{ "_id" : 124, "IDD" : 124, "Sc" : { "Field1" : { "fl" : "something" }, "Field2" : ""} }}
{{ "_id"…

Common Work
- 1
- 1
0
votes
1 answer
Document.parse() constructor not working for nested json array
I have one extended json string.
{"_id": {"oid": "59a47286cfa9a3a73e51e72c"}, "theaterId": {"numberInt": "101100"}, "location": {"address": {"street1": "340 XDW Market", "city": "Bloomington", "state": "MN", "zipcode": "12427"}, "geo": {"type":…

Dunggeon
- 92
- 1
- 1
- 11
0
votes
1 answer
How to parse a bson.Document
I have a java code that retrieves a bson.Document from MongoDB.
An example JSON/BSON document is:
{
"field1": "text1",
"field2": {
"field2Sub1": "text2"
}
}
In my java code I manipulate it like this to get values of field1 and…

Artanis Zeratul
- 963
- 2
- 14
- 40
0
votes
1 answer
MongoDB BsonDocument - Serialize JSON as key-object
I have a doubt if it is possible to serialize a collection of BsonDocument results as a JSON pair of key objects.
For example, I attach a piece of code that creates a collection of BsonDocument with and _id and name as fields,
using…

Jordi Espada
- 419
- 4
- 13
0
votes
1 answer
Convert a bson Document to byte array java
Have a use case where I need to compress and store a org.bson.Document into cache. I am using zstd compression which expects a byte array. Not able to find a way to convert Document into byte array.

vidushi dwivedi
- 41
- 5
0
votes
1 answer
MongoDb driver C# Filter editing
Maybe it is a simple question, but I stack on it and cannot go ahead.
I need to make a query to MongoDb via C# driver.
I can easily generate a complex filter by using FilterDefinition myFilter ...
new FilterDefinition myFilter = {…

user1542557
- 181
- 1
- 1
- 4