如何使用Node.js在MongoDB中将“自定义”位读/写为二进制数据?
我正在尝试做这样的事情:
let bits = [0, 1, 1, 0, 0, 1];
let properFormat = convertToBin(bits);
db.collection("bin").insertOne({
index: 12345,
bin: properFormat
});
this.db.collection("bin").findOne({
index: 12345
}, {
bin: 1
}).then((doc) => {
if (...