nvim-dbee icon indicating copy to clipboard operation
nvim-dbee copied to clipboard

[MongoDB] Failed to List Databases

Open dunix241 opened this issue 1 year ago • 3 comments

Steps to reproduce:

  1. Add a MongoDB data source
  2. Place the cursor over the source
  3. Perform the toggle (o) action
  4. Get the error
E5108: Error executing lua: function DbeeConnectionListDatabases[1]..remote#define#request, line 2: Vim(let):Error invoking '0:function:DbeeConnectionListDatabases' on channel 5:
c.ListDatabases: switcher.ListDatabases: failed to retrieve database names: (AtlasError) Unallowed argument in listDatabases command: filter
stack traceback:
	[C]: in function 'DbeeConnectionListDatabases'
	/mnt/f/Projects/nvim-dbee/lua/dbee/handler/init.lua:256: in function 'connection_list_databases'
	/mnt/f/Projects/nvim-dbee/lua/dbee/ui/drawer/convert.lua:95: in function 'lazy_children'
	/mnt/f/Projects/nvim-dbee/lua/dbee/ui/drawer/init.lua:208: in function 'expand_node'
	/mnt/f/Projects/nvim-dbee/lua/dbee/ui/drawer/init.lua:293: in function </mnt/f/Projects/nvim-dbee/lua/dbee/ui/drawer/init.lua:285>

Screenshot

dunix241 avatar Aug 28 '24 08:08 dunix241

Same error here

spencer-thompson avatar Oct 23 '24 02:10 spencer-thompson

I got a similar error, but not the exact same

E5108: Error executing lua: function DbeeConnectionListDatabases[1]..remote#define#request, line 2: Vim(let):Error invoking '0:function:DbeeConnectionListDatabases' on channel 5:
c.ListDatabases: switcher.ListDatabases: failed to retrieve database names: (AtlasError) Expected user provided "name" field in filter to be regex or string was primitive.D instead
stack traceback:
        [C]: in function 'DbeeConnectionListDatabases'
        ...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/handler/init.lua:256: in function 'connection_list_databases'
        ...share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/convert.lua:95: in function 'lazy_children'
        ...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:208: in function 'expand_node'
        ...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:293: in function <...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:285>

It looks like the command to filter the database list is malformed. Funny enough, comparing the code with the documentation, it looks fine.

I have no experience with Go, but I'm down to fixing this, since MongoDB probably isn't priority for the maintainers, and I want something nice to migrate out of Mongo Compass.

FelipeSharkao avatar Dec 06 '24 14:12 FelipeSharkao

Hello guys, I found a perfect alternative for MondoDB client which is vi-mongo it's like lazygit and integrates with neovim pretty well. Highly recommend it.

I tried to dive into the code to see what I could do but failed even with newer Mongo driver.

dunix241 avatar Dec 07 '24 09:12 dunix241