Data Dictionary Storage and Retrieval with MongoDB and Node.js Application - node.js

I have the following requirement in my project.
It is a reporting application so mainly will be storing data about my entities once and most of the times will be retrieving it and showing them on the webpage as different reports. I am using node.js and mongodb for this project.
The data is in the form of excel. There are more than 2000 columns and each column has one short code like s0a_1, s0a_2, s1a_1, s1a_2 etc. Each column code is mapped to a long meaningful text. For example, s01_1 -> What is the name of the person ? , s01_2 -> 'Project Name' etc. And for each column there will be a corresponding value which is a number most of the time.
In my reports, I need to show long meaningful text and corresponding value.
So, what is the best way to achieve this ?
We can think of the following ways:
Create a collection in mongo and store shortcode/text as key value pair and each time I replace short code with text before sending response to the client.
Store in a property file as key value pair
Use redis for this specific purpose
Any help will be appreciated.
Thanks.

Related

Concatenated SQL fields in selector and/or custom PXDimension

We have a set of BLC/DAC for a customization that has multiple tables with the given relationship
Table1 - T1ID (int-autoincrement), T1CD (char-substitute key)
Table2 - T2ID (int-autoincrement), T2CD (char-subsitute key), T1ID (reference to T1ID)
where the records in Table2 are unique for each given T1ID selected.
The initial design specification was for the users to select first the Table1 value, then the Table2 value (UsrTable1Value, UsrTable2Value respectively) in the data entry screens.
The users have recently asked if it's possible to combine these into one field simular to a Dimension selector so that there is one field resulting in "Table1-Table2" stored as T2ID.
My first thought was to simply create a subclassed dac with a concatenated property for T1CD-T2CD and base the substitute key off that however performance is a problem when that is done (1.6 million records). The delay is in the framwork side as it appears it processes the entire recordset when generating the concatenated substitute key.
Based on that I thought perhaps instead to simply generate a PXDimension configuration for this however I can't find any reference to make Dimension 2 rely on the value of Dimension 1.
I know i could always create a view that does this but i'd prefer to keep it within the framework if possible.
That basically brings me to two questions
1) Outside of a view, is there way to concatenate fields in the BQL so the lifting is done on the SQL and not with a calculated property?
2) Does anyone have or know of a sample of custom Dimensions where the values in level 2 depend on the value in level 1?
Any suggestions would be appreciated.
Out of the box, dimension selectors are designed to work only with Segmented Keys and won't be able to handle values from multiple tables. In theory, it can be possible to populate segment popup from different tables within a custom DimentionSelectorAttribute. However, this will additionally require to store each T1ID/T2ID pair in a separate table with some other column declared as a key (same concept used in the Sub table to store sub accounts: SubID is a key and SubCD stores values composed from multiple segments).
My personal opinion, the effort is just not worth it. Going one step further, I would check with the customer on how they expect navigation buttons (first, prev, next, last) to work with their segmented input control? If following standard Acumatica UI design with separate input created for every key field, no additional effort is needed to properly handle both data entry and navigation.

Can I use any other column name than id in my xamarin forms app?

As the title suggest, I was wondering if it was possible to use any other column name for the index than id?
The documentation for creating a Mobile Backend in Azure and Xamarin Forms app stipulates that the index column must be id all lower case for the API to return data. What if your index column is called something else, for example idx_index.
My issue is that my database already exists and there are a lot of tables. I'd like to avoid having to rename the index columns in the database if I can.
Is there anything I can do that would help me avoid this problem or does it look like I'll need to rename my columns to id?
No - you cannot use any other name other than id. This is in-built into the SDK and you would need to alter both the server and client SDKs (and compile new ones) to support something else. This is a non-trivial update.
Since my database already existed all the column naming was set. To get around this problem when it came to Azure and it's expectation of a column called id I simply cast the column names in some custom views which were specific to my mobile app. For example:
SELECT index_idx as id,
name,
location
FROM mytable

Transistioning from Excel to Access - challenges in assigning/determining a Primary Key

I am currently working on attempting to transition a large database of testing records from Excel to Access to allow for better relational analysis between different groups; however, with how our team completes tests the same tests are repeated on a cycle making it difficult to capture a unique ID -
I have considered assigning one for each test but then realized the ID would still repeat when the test is ran again. I have considered using the timeframe of the review but that would also be repeated unless I build a separate table for each individual test. I have considered using the issue number that would be assigned to items requiring action, but this would not apply to all rows therefore access would not allow it.
Within our current database we capture test name, type, timeframe reviewed, start and end dates, result types, descriptions and root cause, and issue identifiers if remediation is required.
Does anyone have any suggestions on how I might transition this data into Access without losing the Primary Key feature on certain tables?
I would suggest creating a master table to identify your 'test types' (the things that can be run multiple times). You populate this table with the unique entries in the test name column in your Excel data. This column in your Excel data then becomes a 'foreign key' pointing to your master 'test types' table.
Ideally I would recommend using an autonumber as the primary key in the master table and then replacing the test name column in your Excel data with the numeric values generated when you populate the 'test types' table.
You would then import your Excel data into a table that is recording 'Test Run Instances'. Again I would set an autonumber field as the primary key on this table. Other columns in your Excel data that contain repeating data would make candidates for other 'master' tables (e.g. you talk about 'result types' - is there a set list of these that could be moved out to a master table?).

How to use view parameter "Keys" for date fields at Domino Data Service REST API

Domino REST API doesn't return any view data if I use date at query parameter "Keys". In case of Extension Library REST Control we can use NotesDateTime() or #Date() to make it work.
But I don't know how to use the same at Domino REST API call. Anybody knows how to use date as key?
This is the the sample url,
https://demodomain.com/demo.nsf/api/data/collections/name/viewName?sortcolumn=DateField&keys=1999-03-24T22:16:17Z
I looked at the source code for the Domino data service. The view entries resource (/{db}/api/data/collections/name/{view}) always assumes the keys parameter is a string. So apparently it's unable to match any value in a date column.
This behavior could be improved. Meanwhile, you could work around the limitation by creating a separate sort column with the TEXT representation of the same date. Use the new column name in the sortcolumn parameter and the view entries resource should be able find rows that match the keys parameter.

Lotus Notes: What will be the view selection formula to select a form which is in different database?

My view is one application and a required form along with few fields are in different application.
Point one: A View's selection formula does not "select a form". It selects documents. These documents are (usually) created with a Form, and they (usually) contain an item called "Form" which contains the name of the Form that they were created with. So a selection formula SELECT Form = "Foo" means that the view will show all documents with an item named Form that contains the value "Foo".
Point two: A View can only select documents that are in the same database that contains the View. It cannot select documents that exist in another database.
Ergo, there is no possible forumla that selects documents in another database that were created with a given Form.
I'm assuming you probably have some keyword documents in a different database, and you'd like to use a key in the main document to pull some matching information from the keyword database. In other words, you'd like to do a "join" in your Notes view.
You can't do this, never mind whether the documents are in the same database. This is not a relational database.
There are options, however.
You could create a "user definable" column and automatically update the column formula in a profile document so that the formula can calculate the keyword correspondences. You would have a periodic agent look at the keyword database and construct an updated formula such as, #Select("a"; "b"; "c";...; ChoiceNo) to convert the number field ChoiceNo to the value "a" (for 1), "b" (for 2), etc. If you can write a formula to display the correct values for the current keywords, this is workable provided the list never gets too long.
Domino servers are capable of accessing a DB2 relational database to construct a view index, using a feature called DB2NSF. So you can actually do a join -- but your NSF data has to be stored in DB2 as its back-end, rather than beinf stored in the NSF, for this to work. This is probably going to be more work than it's worth to you for this application.
If it is an XPages application, you can create your own data set however you like for feeding to a repeat control.

Resources