db
db
get the db handler from MongoDB
save
save
will commit the current state of the TimeEntry
to the database.
duration
duration
returns the time between this entry and the next.
find
find
will return a single document. The query will use the provided _id
.
search $config
%options
...
search
will return an array of TimeEntry that fit the given %options
.
%options
can include the following:
query
-
This is the query syntax available via MongoDB::Collection.
sort
-
If present, the results will be sorted via the hashref given by this option.
limit
-
If present, the results will limited to the number provided.
last_entry
last_entry
will return the last TimeEntry in the db.
TO_JSON
TO_JSON
will return the entry as a JSON convertible hash.