Revision 383038326236 () - Diff

Link to this snippet: https://friendpaste.com/3h2IgFF1RXvwxpDGiMDOdS
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Erlang R14B01 (erts-5.8.2) [source] [smp:2:2] [rq:2] [async-threads:4] [hipe] [kernel-poll:true]

Eshell V5.8.2 (abort with ^G)
1> Apache CouchDB 1.2.0affcb1cc-git (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.37.0>] Apache CouchDB has started on http://127.0.0.1:5985/

1> rr("src/couchdb/couch_db.hrl").
[att,btree,changes_args,db,db_header,doc,doc_info,
extern_resp_args,full_doc_info,group,httpd,index_header,
reduce_fold_helper_funs,rev_info,user_ctx,view,
view_fold_helper_funs,view_query_args]
2>
2> {ok, Db} = couch_db:open_int(<<"foo">>).
** exception error: undefined function couch_db:open_int/1
3> {ok, Db} = couch_db:open_int(<<"foo">>, []).
{ok,#db{main_pid = <0.172.0>,update_pid = <0.173.0>,
compactor_pid = nil,
instance_start_time = <<"1300376907753315">>,fd = <0.174.0>,
updater_fd = <0.170.0>,fd_ref_counter = <0.176.0>,
header = #db_header{disk_version = 5,update_seq = 0,
unused = 0,fulldocinfo_by_id_btree_state = nil,
docinfo_by_seq_btree_state = nil,
local_docs_btree_state = nil,purge_seq = 0,
purged_docs = nil,security_ptr = nil,revs_limit = 1000},
committed_update_seq = 0,
fulldocinfo_by_id_btree = #btree{fd = <0.170.0>,root = nil,
extract_kv = #Fun<couch_db_updater.10.53859553>,
assemble_kv = #Fun<couch_db_updater.11.54897888>,
less = #Fun<couch_btree.5.3534514>,
reduce = #Fun<couch_db_updater.12.127270801>},
docinfo_by_seq_btree = #btree{fd = <0.170.0>,root = nil,
extract_kv = #Fun<couch_db_updater.13.74802401>,
assemble_kv = #Fun<couch_db_updater.14.116192360>,
less = #Fun<couch_btree.5.3534514>,
reduce = #Fun<couch_db_updater.15.3285619>},
local_docs_btree = #btree{fd = <0.170.0>,root = nil,
extract_kv = #Fun<couch_btree.0.8709291>,
assemble_kv = #Fun<couch_btree.1.100429438>,
less = #Fun<couch_btree.2.3534514>,reduce = nil},
update_seq = 0,name = <<"foo">>,
filepath = "/home/fdmanana/git/hub/couchdb2/couchdb/tmp/lib/foo.couch",
validate_doc_funs = [],security = [],security_ptr = nil,
user_ctx = #user_ctx{name = null,roles = [],
handler = undefined},
waiting_delayed_commit = nil,revs_limit = 1000,
fsync_options = [before_header,after_header,on_file_open],
options = []}}
4> Doc = #doc{id = <<"foo">>, body = 1234}.
#doc{id = <<"foo">>,
revs = {0,[]},
body = 1234,atts = [],deleted = false,meta = []}
5> couch_db:update_doc(Db, Doc, []).
{ok,{1,
<<36,105,104,115,24,235,79,9,135,114,117,252,72,164,164,
236>>}}
6>