|
@@ -73,8 +73,10 @@ list_to_doc([F|Fields],[V|Values]) ->
|
|
make_id({<<ObjectId:12/binary>>}) -> {ObjectId};
|
|
make_id({<<ObjectId:12/binary>>}) -> {ObjectId};
|
|
make_id(Term) -> to_binary(Term, true).
|
|
make_id(Term) -> to_binary(Term, true).
|
|
|
|
|
|
-make_field({geo_point, Coords}) when length(Coords) == 2 -> {type, <<"Point">>, coordinates, Coords};
|
|
|
|
-make_field({geo_polygon, Coords}) when is_list(Coords) -> {type, <<"Polygon">>, coordinates, Coords};
|
|
|
|
|
|
+make_field({geo_point, Coords}) when length(Coords) == 2; length(Coords) == 0 ->
|
|
|
|
+ {type, <<"Point">>, coordinates, Coords};
|
|
|
|
+make_field({geo_polygon, Coords}) when is_list(Coords) ->
|
|
|
|
+ {type, <<"Polygon">>, coordinates, Coords};
|
|
make_field(V) ->
|
|
make_field(V) ->
|
|
if is_atom(V) -> case V of
|
|
if is_atom(V) -> case V of
|
|
true -> to_binary(V);
|
|
true -> to_binary(V);
|