Skip to content

Commit 4d6b3b0

Browse files
committed
Replace deprecated command with newer alternative
> Deprecated mongosh Method > This method is deprecated in mongosh. For alternative methods, see > Compatibility Changes with Legacy mongo Shell. > https://www.mongodb.com/docs/mongodb-shell/reference/compatibility/#std-label-compatibility See https://www.mongodb.com/docs/manual/reference/method/db.collection.insert/
1 parent d628447 commit 4d6b3b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/provider/mongodb_database/mongodb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def self.prefetch(resources)
2929

3030
def create
3131
if db_ismaster
32-
out = mongo_eval('db.dummyData.insert({"created_by_puppet": 1})', @resource[:name])
32+
out = mongo_eval('db.dummyData.insertOne({"created_by_puppet": 1})', @resource[:name])
3333
raise "Failed to create DB '#{@resource[:name]}'\n#{out}" if %r{writeError} =~ out
3434
else
3535
Puppet.warning 'Database creation is available only from master host'

0 commit comments

Comments
 (0)