Is it possible to run MongoDB javascript scripts in DBeaver
2
votes
1
answer
1796
views
DBeaver's wiki shows a simple query against a Mongo database but what about admin scripts? It would be great to develop these in DBeaver but I've tried a few permutations to no avail.
Here's an example of a maintenance script:
var cursor = db.album.find({}, {"k": 1 })
var albumKeys = []
while( cursor.hasNext() ){
albumKeys.push( cursor.next()['k']);
}
cursor = db.song.find({ "alb" : { $not : { $in : albumKeys } } } )
var songsWithMissingAlbum = []
while( cursor.hasNext() ) {
songsWithMissingAlbum.push(cursor.next())
}
printjson(songsWithMissingAlbum)
Asked by Rob Shepherd
(131 rep)
May 10, 2017, 10:46 AM
Last activity: Jun 25, 2025, 08:06 AM
Last activity: Jun 25, 2025, 08:06 AM