Docs Menu

Docs HomeMongoDB Manual

listFiles()

Note

The native method listed here is for the legacy mongo shell.

To use native methods in mongosh, see Native Methods in mongosh.

listFiles()

Returns an array, containing one document per object in the directory. This function operates in the context of mongosh. The fields included in the documents are:

name

A string which contains the pathname of the object.

baseName

A string which contains the name of the object.

isDirectory

A boolean to indicate whether the object is a directory.

size

The size of the object in bytes. This field is only present for files.

←  isInteractive()load() →
Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.