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,
}...
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...
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...
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 ...
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...
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...
7
Solved
This is my code:
MongoDBSingleton dbSingleton = MongoDBSingleton.getInstance();
MongoDatabase db;
try {
db = dbSingleton.getTestdb();
MongoIterable<String> mg = db.listCollectionNames();
...
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 && ...
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...
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...
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?
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...
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....
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...
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...
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...
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...
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
1 Next >
© 2022 - 2025 — McMap. All rights reserved.