Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] compiler, database, mongo: Updating of sum path

  • Loading branch information...
commit 420d1ce2898400423b14a4b64162e7d7279f308a 1 parent d84fca7
@BourgerieQuentin BourgerieQuentin authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 opa/pass_MongoAccessGeneration.ml
View
19 opa/pass_MongoAccessGeneration.ml
@@ -498,17 +498,14 @@ module Generator = struct
let annotmap, uexpr =
if ty_is_sum gamma dataty then (
let annotmap, uexpr = update_to_expr ~set:false gamma annotmap u in
- match u with
- | DbAst.UExpr _ ->
- (* Special case for upsert without '$' modifier, needs
- _id to the update query. *)
- let _id =
- (Format.sprintf "/%a"
- (Format.pp_list "/" Format.pp_print_string) strpath)
- in
- let annotmap, _id = C.string annotmap _id in
- add_to_document gamma annotmap "_id" _id uexpr
- | _ -> annotmap, uexpr
+ (* Special case for upsert without '$' modifier, needs
+ _id to the update query. *)
+ let _id =
+ (Format.sprintf "/%a"
+ (Format.pp_list "/" Format.pp_print_string) strpath)
+ in
+ let annotmap, _id = C.string annotmap _id in
+ add_to_document gamma annotmap "_id" _id uexpr
) else (
let u =
if ty_is_const gamma dataty then DbAst.UFlds [["value"], u]
Please sign in to comment.
Something went wrong with that request. Please try again.