Hello,
it seems to me that function db:open() and collection() are equivalent.
db:open - in spite of its name - does not change any state, but just returns the document nodes contained in a database. Which is what collection() does (in BaseX). The only differences are differences of parameter style: (a) a database path (if any) is an extra parameter in db:open(), whereas with the collection() function it is appended to the db name (e.g. collection('db/data'); and (b) db:open() lets one specify the database by name or by node, whereas with collection() it is (of course) always only by name.
If something is wrong with this summary, I would appreciate a correction.
Kind regards,
Hans-Juergen