Read Document

Operation Name

Read Document

Function Overview

Reads data stored in collection.

Data Model

Table model type.

Properties

For information about using variables, refer to "Variables".
Basic settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not available Enter the name to show on the script canvas.  
Required setting
Item name Required/Optional Use of variables Description Remarks
Destination Required Not available Select a global resource.
  • [Add]:
    Adds a new global resource.
  • [Edit list]:
    Enables to edit the global resource settings in the "Edit resource list".
 
Collection name Required Available Enter or select the targeted collection name.
Query selector Required Available Enter a query selector to issue to the database.
  • Enter a query selector of find command.
  • If only {} is entered, all documents will be gotten.
Schema definition Required - Shows the schema definition of collection specified in [Collection name].
  • In mapper schema, shows the item names checked at [Read target] among the columns displayed in [Schema definition].
  • In the following cases, schema definition cannot be shown.
    • If read authorization does not exist in the specified collection
    • If the specified collection does not exist
    • If no document exists in the specified collection
    • If variable is specified in [Collection name]
    • If [Collection name] is not entered
    • If error occured in [Collection name]
Schema definition/Read target Optional Not available Select whether to include each collection column specified in [Collection name] to read target.
  • [Checked]:
    Includes in read target.
  • [Not checked]:(default)
    Does not include in read target.
  • Shows the item names of checked columns in mapper schema.
  • Clicking the check box shown in the header enables batch operation.
  • One or more columns must be checked.
Schema definition/Item name Required Available Enter an item name of collection specified in [Collection name].  
Schema definition/type Required Not available Select a type of [Item name].
  • Displayed in the format of "<Internal data type>".
      Internal
    • Inner data type:
      Data type used internally in DataSpider.
      Refer to "Internal data type" for details.
Property action
Item name Description Remarks
Update collection name list Shows the collection name list that exists in the destination specified in [Destination].
  • If [Destination] is selected, it is enabled.
Execution test Issues a query selector to the collection specified in [Collection name]. As the result, the number of records gotten will be shown.
  • It is disabled in the following cases.
    • If read authorization does not exist in the specified collection
    • If the specified collection does not exist
    • If variable is specified in [Collection name]
    • If [Collection name] is not entered
    • If error occured in [Collection name]
    • If [Query selector] is not entered
Update schema definition Updates the schema definition of collection specified in [Collection name].
  • Gets the latest 1000 documents from the collection specified in [Collection name], and extract item name and type.
  • If the MongoDB data types which is not supported exist in the gotten items, the type will not be set.
  • For details on the supported MongoDB data types, refer to "MongoDB Adapter Restrictions".
  • It is disabled in the following cases.
    • If read authorization does not exist in the specified collection
    • If the specified collection does not exist
    • If no document exists in the specified collection
    • If variable is specified in [Collection name]
    • If [Collection name] is not entered
    • If error occured in [Collection name]
    • If [Query selector] is not entered
Read settings
Item name Required/Optional Use of variables Description Remarks
Sort settings Optional - Based on the item names specified as read target in [Schema definition], set the sort order of documents.
  • It is disabled in the following cases.
    • If [Update sort settings] has not been clicked
    • If no read target is specified in [Schema definition]
Sort settings/Item name Optional Not available Select the item name specified as read target in [Schema definition].
  • If [Update sort settings] is not clicked, nothing will be shown in the pull down menu.
Sort settings/Sort order Optional Not available Displays [Sort order].
  • [Ascending order]:(default)
    Sort by ascending order.
  • [Decending order]:
    Sort by descending order.
Maximum getting count Optional Available Set [Maximum getting count].
  • If omitted, or is entered "0", gets all.
  • The range of valid value is 0-2147483647.
Property action
Item name Description Remarks
Update sort settings
  • Based on the item name specified in read target of [Schema definition], updates the pull down menu of sort settings/item name.
  • If no read target item exists in [Schema definition], cannot be executed.
Data processing method
Item name Required/Optional Use of variables Description Remarks
Data processing method Required Not available Select a data processing method.
  • [Use script settings]:(default)
    Applies the setting of mass data processing setup in script property to the adapter.
  • [Disable]:
    Does not perform mass data processing.
  • [Enable]:
    Performs mass data processing.
 
Comment
Item name Required/Optional Use of variable Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

Schema

Input schema

None.

Output schema

Column number differs depending on the [Schema definition] setting.
Refer to "Table model type schema" for schema structure.

Loading Schema in Mapper

Schema is loaded automatically.
For details, refer to "Edit schema".

Mass Data Processing

Mass data processing is supported.

PSP usage

PSP is available.
For details on PSP, refer to "Parallel Stream Processing".

Available Component Variables

Component variable name Description Remarks
count Stores the number of read data.
  • Default value is null.
  • Value is not stored in PSP.
message_category Stores the category of message code corresponding to the occurred error.
  • Default value is null.
message_code Stores the code of message code corresponding to the occurred error.
  • Default value is null.
message_level Stores the severity of message code corresponding to the occurred error.
  • Default value is null.
error_type Stores the error type of occurred error.
  • Default value is null.
  • Error is represented in the format depicted below.
    Example: “java.io.FileNotFoundException”
  • The value may vary depending on the DataSpider Servista version.
error_message Stores the error message of occurred error.
  • Default value is null.
  • The value may vary depending on the DataSpider Servista version.
error_trace Stores the trace information of occurred error.
  • Default value is null.
  • The value may vary depending on the DataSpider Servista version or the client application used.

Main Exceptions

Exception name Cause Solution
ResourceNotFoundException
Enter the destination.
[Destination] is not specified. Specify [Destination].
ResourceNotFoundException
Resource is not defined. Name:[<Global resource name>]
Resource definition selected in [Destination] is not found. Check the global resource specified in [Destination].
MongoTimeOutException
'Authentication failed.'
There is something wrong with the user name or the password of the global resource specified in [Destination], or the user does not have permission. Check the global resource specified in [Destination].
InvalidPropertyConfigurationException
Enter collection name.
[Collection name] is not specified. Specify [Collection name].
InvalidPropertyConfigurationException
Schema column is not specified.
[Read target] in [Schema definition] is not specified. Select one or more [Read target] in [Schema definition].
com.mongodb.util.JSONParseException There is something wrong with [Query selector]. Check the syntax of [Query selector].

Notes