Skip to content

Commit

Permalink
[sc-29393] MongoDB crawler ignore system collections
Browse files Browse the repository at this point in the history
  • Loading branch information
usefulalgorithm committed Oct 17, 2024
1 parent 8ee8f17 commit 93c04a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metaphor/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ infer_schema_sample_size: <int> # Number of documents to sample in a collection
excluded_databases: # Databases to ignore. By default the databases "admin", "config", "local", "system" are excluded.
- db1
- db2
excluded_collections: # Collections to ignore.
excluded_collections: # Collections to ignore. By default the system specific collections are ignored, see https://www.mongodb.com/docs/manual/reference/system-collections/#database-specific-collections.
- coll1
- coll2
```
Expand Down
6 changes: 5 additions & 1 deletion metaphor/mongodb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class MongoDBConfig(BaseConfig):
excluded_databases: Set[str] = Field(
default_factory=lambda: set(["admin", "config", "local", "system"])
)
excluded_collections: Set[str] = Field(default_factory=set)
excluded_collections: Set[str] = Field(
default_factory=lambda: set(
["system.buckets", "system.profile", "system.js", "system.views"]
)
)

@field_validator("auth_mechanism", mode="before")
def _validate_auth_mechanism(cls, auth_mechanism: str):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metaphor-connectors"
version = "0.14.126"
version = "0.14.127"
license = "Apache-2.0"
description = "A collection of Python-based 'connectors' that extract metadata from various sources to ingest into the Metaphor app."
authors = ["Metaphor <[email protected]>"]
Expand Down

0 comments on commit 93c04a0

Please sign in to comment.