Permalink
Browse files

WHISTLE-42: when referencing the id of the doc use _id

  • Loading branch information...
1 parent 7ce2f83 commit 74a7921a97618c2595ea48dba5d16c490c7cd4c0 @k-anderson k-anderson committed May 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 whistle_apps/src/whapps_util.erl
@@ -144,11 +144,11 @@ find_oldest_doc(Docs) ->
First = hd(Docs),
{_, OldestDocID} = lists:foldl(fun(Doc, {Created, _}=Eldest) ->
case wh_json:get_integer_value(<<"pvt_created">>, Doc) of
- Older when Older < Created -> {Older, wh_json:get_value(<<"id">>, Doc)};
+ Older when Older < Created -> {Older, wh_json:get_value(<<"_id">>, Doc)};
_ -> Eldest
end
end
- ,{wh_json:get_integer_value(<<"pvt_created">>, First), wh_json:get_value(<<"id">>, First)}
+ ,{wh_json:get_integer_value(<<"pvt_created">>, First), wh_json:get_value(<<"_id">>, First)}
,Docs),
{ok, OldestDocID}.

0 comments on commit 74a7921

Please sign in to comment.