bson Questions

1

Returning Vector of document objects from rust to python fails. I have a struct and method implementation in rust as follows. use mongodb::{ bson::{Bson, Document}, error::Error, sync::Client, }...
Ab asked 17/7, 2020 at 14:37

6

Getting this error. my typescript version is 4.5.4 and "@types/mongodb": "~3.3.1", "@types/mongoose": "~5.5.17". any idea how to solve ../@types/mongodb/inde...
Hedve asked 20/2, 2023 at 17:55

7

I found some examples on how to use ObjectId within BaseModel classes. Basically, this can be achieved by creating a Pydantic-friendly class as follows: class PyObjectId(ObjectId): @classmethod d...
Lissotrichous asked 14/7, 2023 at 10:35

2

The number is larger than 9223372036854775807 - too big for NumberLong, which is mongo's native 64-bit long type. What's the best way to do this/the best field type? Is it possible to preserve an...
Amourpropre asked 30/3, 2017 at 22:56

4

Solved

I have a problem when querying mongoDB with nested objects notation: db.messages.find( { headers : { From: "[email protected]" } } ).count() 0 db.messages.find( { 'headers.From': "[email&#160...
Malpractice asked 14/4, 2013 at 18:21

3

I'm trying to import json_util in my environment file: from bson import json_util I get this import error: no module named bson. I tried to pip install and uninstall pymongo and bson - but noth...
Snowclad asked 7/2, 2016 at 14:53

5

Solved

With C# 6 I can write: public class Person { public Guid Id { get; } public string Name { get; } public Person(Guid id, string name) { Id = id; Name = name; } } Unfortunately a class like...
Mithridatism asked 20/9, 2016 at 22:41

3

I'm just learning about MongoDB. Is there an easy way to export/import data from MongoDB? The task at hand is simple: Using MongoDB Cloud, copy a document from a collection (using the Copy Document...
Cystic asked 3/7, 2020 at 5:7

6

Solved

I'm working in Python with MongoDB trying to save an array of floats tightly. I can Create and store correctly * but I CANNOT RETRIEVE THE DATA IN A USABLE FORMAT. >>> import random, a...
Jaffe asked 27/2, 2014 at 18:52

7

Solved

This is my code: MongoDBSingleton dbSingleton = MongoDBSingleton.getInstance(); MongoDatabase db; try { db = dbSingleton.getTestdb(); MongoIterable<String> mg = db.listCollectionNames(); ...
Wellbeloved asked 7/10, 2016 at 18:6

2

Solved

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && ...
Latour asked 2/4, 2020 at 16:50

3

Solved

So here is my question. I have an array which are stored the _ids of mongodbs objects. Whats the right way to retrieve them all in one query using the mgo and bson package? So if the array is like...
Toponym asked 17/10, 2014 at 15:22

3

Solved

I'm using the 'bson' npm package in the browser for converting / serializing a JSON object to BSON. The documentation says that it returns a Node.js buffer. The documentation of Node.js says that a...
Syndic asked 13/3, 2018 at 14:50

2

Solved

I have a shell command that calls a MongoDB command and produces a BSON output. I then want to parse that output with jq so I need to convert the BSON to JSON using jq's tojson. echo "db._adminCom...
Lipstick asked 16/10, 2014 at 12:8

6

Solved

I have a string that contains a JSON. The only thing I know about this JSON is that it is valid. How to turn this string into BSON?
Incorporable asked 13/11, 2015 at 3:34

3

Solved

Try to convert JObject to BsonDocument using this example https://www.newtonsoft.com/json/help/html/WriteJTokenToBson.htm (BsonWriter obsolete, so I use BsonDataWriter) var jObject = JObject.Parse...
Nalepka asked 29/5, 2020 at 6:51

4

I would like to get ObjectID as a string because I have other storage types, so I want to avoid to use primitive.ObjectID in my struct to keep the layers independent. I'm new to Golang, thanks. pa...
Solicit asked 12/5, 2020 at 3:48

2

Solved

Is there a way to get the size of all the documents that meets a certain query in the MongoDB shell? I'm creating a tool that will use mongodump (see here) with the query option to dump specific da...
Cyprus asked 17/11, 2015 at 21:35

7

Solved

I am currently learning and applying MongoDB for a small financial related project. When I read MongoDB in Action, it says: The only other issue that commonly arises with BSON numeric types is th...
Sachsen asked 18/7, 2012 at 12:57

3

Solved

I have read somewhere that you can store python objects (more specifically dictionaries) as binaries in MongoDB by using BSON. However right now I cannot find any any documentation related to this....
Clyte asked 6/8, 2013 at 20:14

11

Solved

I don't seem to be able to get even the most basic date query to work in MongoDB. With a document that looks something like this: { "_id" : "foobar/201310", "ap" : "foobar", "dt" : ISODate("201...
Arapaima asked 6/11, 2013 at 18:28

2

Datetime fields in structs are being serialized to Strings instead of ISODates when using the Rust Mongo driver prototype. How do I get the fields to be saved as ISODate? use chrono::{DateTime, Ut...
Foe asked 17/4, 2019 at 21:6

5

Solved

I want to consume the raw output of some MongoDB commands in other programs that speak JSON. When I run commands in the mongo shell, they represent Extended JSON, fields in "shell mode", with speci...
Ralston asked 19/8, 2015 at 13:39

3

Solved

Prehistory: I have a class hierarchy (a big one) which was generated from an XML schema (XSD). MyObj obj; Nowadays: I need to parse a string value, which is actually an XML to an object using th...
Roma asked 3/8, 2016 at 15:20

5

Solved

I'm stuck with install bson_ext gem with 1.5.1 version. I've tried almost everything what I found on web but nothing helps. I tried to reinstall ruby, rvm and so on. I am using: RVM MacOs Catalina...
Stereophonic asked 1/10, 2020 at 9:38

© 2022 - 2025 — McMap. All rights reserved.