|
4 | 4 | // User-provided JSON is converted to a tree. This tree is stored transparently in Redis.
|
5 | 5 | // It can be operated on (e.g. INCR) and serialized back to JSON.
|
6 | 6 |
|
7 |
| -use bson::decode_document; |
8 | 7 | use crate::backward;
|
9 | 8 | use crate::nodevisitor::NodeVisitorImpl;
|
| 9 | +use bson::decode_document; |
10 | 10 | use jsonpath_lib::{JsonPathError, SelectorMut};
|
11 | 11 | use redismodule::raw;
|
12 | 12 | use serde_json::{Map, Value};
|
@@ -147,7 +147,7 @@ impl RedisJSON {
|
147 | 147 | data: &str,
|
148 | 148 | path: &str,
|
149 | 149 | option: &SetOptions,
|
150 |
| - format: Format |
| 150 | + format: Format, |
151 | 151 | ) -> Result<bool, Error> {
|
152 | 152 | let json: Value = RedisJSON::parse_str(data, format)?;
|
153 | 153 | if path == "$" {
|
@@ -193,7 +193,7 @@ impl RedisJSON {
|
193 | 193 | let results = self.get_doc(path)?;
|
194 | 194 | let res = match format {
|
195 | 195 | Format::JSON => serde_json::to_string(&results)?,
|
196 |
| - Format::BSON => return Err("Soon to come...".into()) //results.into() as Bson, |
| 196 | + Format::BSON => return Err("Soon to come...".into()), //results.into() as Bson, |
197 | 197 | };
|
198 | 198 | Ok(res)
|
199 | 199 | }
|
@@ -346,8 +346,8 @@ impl RedisJSON {
|
346 | 346 | Value::Null => 0,
|
347 | 347 | Value::Bool(v) => mem::size_of_val(v),
|
348 | 348 | Value::Number(v) => mem::size_of_val(v),
|
349 |
| - Value::String(v) => mem::size_of_val(v), |
350 |
| - Value::Array(v) => mem::size_of_val(v), |
| 349 | + Value::String(v) => mem::size_of_val(v), |
| 350 | + Value::Array(v) => mem::size_of_val(v), |
351 | 351 | Value::Object(v) => mem::size_of_val(v),
|
352 | 352 | };
|
353 | 353 | Ok(res.into())
|
|
0 commit comments